Submission #14469299


Source Code Expand

#include <bits/stdc++.h>
#define INF 1e9
using namespace std;

#define REPR(i,n) for(int i=(n); i >= 0; --i)
#define FOR(i, m, n) for(int i = (m); i < (n); ++i)
#define REP(i, n) for(int i=0, i##_len=(n); i<i##_len; ++i)
#define ALL(a)  (a).begin(),(a).end()
#define endl "\n"

template<class T>bool chmin(T &a, const T &b) { if (b<a) { a=b; return true; } return false; }
template<class T>bool chmax(T &a, const T &b) { if (a<b) { a=b; return true; } return false; }
typedef long long ll;

void solve() {
    int H,W;
    cin >> H >> W;
    int cnt = 0;
    REP(i,H){
        string str; cin >> str;
        for(const auto &it: str) if (it == '#') cnt ++;
    }
    if (cnt == (H+W-1)) cout << "Possible" << endl;
    else cout << "Impossible" << endl;

}

int main() {
    solve();
    return 0;
}

Submission Info

Submission Time
Task A - Shik and Stone
User reud
Language C++ (GCC 9.2.1)
Score 200
Code Size 831 Byte
Status AC
Exec Time 8 ms
Memory 3596 KiB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 200 / 200
Status
AC × 3
AC × 22
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 8 ms 3404 KiB
001.txt AC 2 ms 3384 KiB
002.txt AC 3 ms 3448 KiB
003.txt AC 2 ms 3564 KiB
004.txt AC 2 ms 3372 KiB
005.txt AC 2 ms 3460 KiB
006.txt AC 3 ms 3460 KiB
007.txt AC 2 ms 3564 KiB
008.txt AC 3 ms 3564 KiB
009.txt AC 2 ms 3376 KiB
010.txt AC 2 ms 3376 KiB
011.txt AC 2 ms 3512 KiB
012.txt AC 2 ms 3564 KiB
013.txt AC 2 ms 3400 KiB
014.txt AC 2 ms 3448 KiB
015.txt AC 2 ms 3560 KiB
016.txt AC 2 ms 3464 KiB
017.txt AC 2 ms 3508 KiB
018.txt AC 4 ms 3464 KiB
example0.txt AC 2 ms 3404 KiB
example1.txt AC 2 ms 3596 KiB
example2.txt AC 2 ms 3436 KiB