Submission #5622878
Source Code Expand
#include <iostream> #include <cstdio> #include <cstring> #include <vector> #include <deque> #include <queue> #include <array> #include <set> #include <map> #include <cmath> #include <algorithm> #include <numeric> #include <cassert> #include <utility> #include <functional> #include <bitset> #include <cstdint> using namespace std; using i64 = int64_t; using i32 = int32_t; template<class T, class U> void init_n(vector<T>& v, size_t n, U x) { v = vector<T>(n, x); } template<class T> void init_n(vector<T>& v, size_t n) { init_n(v, n, T()); } template<class T> void read_n(vector<T>& v, size_t n, size_t o = 0) { v = vector<T>(n+o); for (size_t i=o; i<n+o; ++i) cin >> v[i]; } template<class T> void read_n(T a[], size_t n, size_t o = 0) { for (size_t i=o; i<n+o; ++i) cin >> a[i]; } template<class T> T gabs(const T& x) { return max(x, -x); } #define abs gabs i64 h, w; vector<string> a; int main() { cin >> h >> w; read_n(a, h); i64 i = 0, j = 0; while (true) { a[i][j] = '.'; if (i < h - 1 && a[i + 1][j] == '#') ++i; else if (j < w - 1 && a[i][j + 1] == '#') ++j; else break; } for (i64 i = 0; i < h; ++i) { for (i64 j = 0; j < w; ++j) { if (a[i][j] == '#') { cout << "Impossible\n"; return 0; } } } cout << "Possible\n"; return 0; }
Submission Info
Submission Time | |
---|---|
Task | A - Shik and Stone |
User | cottoncotton |
Language | C++14 (GCC 5.4.1) |
Score | 200 |
Code Size | 1368 Byte |
Status | AC |
Exec Time | 1 ms |
Memory | 256 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 200 / 200 | ||||
Status |
|
|
Set Name | Test Cases |
---|---|
Sample | example0.txt, example1.txt, example2.txt |
All | 000.txt, 001.txt, 002.txt, 003.txt, 004.txt, 005.txt, 006.txt, 007.txt, 008.txt, 009.txt, 010.txt, 011.txt, 012.txt, 013.txt, 014.txt, 015.txt, 016.txt, 017.txt, 018.txt, example0.txt, example1.txt, example2.txt |
Case Name | Status | Exec Time | Memory |
---|---|---|---|
000.txt | AC | 1 ms | 256 KB |
001.txt | AC | 1 ms | 256 KB |
002.txt | AC | 1 ms | 256 KB |
003.txt | AC | 1 ms | 256 KB |
004.txt | AC | 1 ms | 256 KB |
005.txt | AC | 1 ms | 256 KB |
006.txt | AC | 1 ms | 256 KB |
007.txt | AC | 1 ms | 256 KB |
008.txt | AC | 1 ms | 256 KB |
009.txt | AC | 1 ms | 256 KB |
010.txt | AC | 1 ms | 256 KB |
011.txt | AC | 1 ms | 256 KB |
012.txt | AC | 1 ms | 256 KB |
013.txt | AC | 1 ms | 256 KB |
014.txt | AC | 1 ms | 256 KB |
015.txt | AC | 1 ms | 256 KB |
016.txt | AC | 1 ms | 256 KB |
017.txt | AC | 1 ms | 256 KB |
018.txt | AC | 1 ms | 256 KB |
example0.txt | AC | 1 ms | 256 KB |
example1.txt | AC | 1 ms | 256 KB |
example2.txt | AC | 1 ms | 256 KB |