Submission #1982418


Source Code Expand

#include <iostream>
#include <algorithm>
#include <string>
#include <vector>
#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <cstring>
#include <stack>
#include <queue>
#include <set>
#include <map>
#include <unordered_map>
#include <ctime>
#include <list>
#include <numeric>
#include <utility>
#include <ctime>
#define INF 1000000000
#define LINF 9000000000000000000
#define mod 1000000007
 
#define rep(i,n) for(int i=0;i<int(n);i++)
#define REP(i,a,b) for(int i=(a);i<int(b);i++)
#define all(x) (x).begin(),x.end()
#define pb push_back
#define mp make_pair
#define MOD(x) (x%(mod))
 
using namespace std;
 
typedef long long ll;
typedef unsigned long long ull;
typedef vector<int> vi;
typedef pair<int,int> pi;
 
// int dx[4]={1,0,-1,0};
// int dy[4]={0,1,0,-1};
bool debug=false;
 
/*---------------------------------------------------*/
/*
int h,w;
char maze[10][10];
int dx[2]={1,0};
int dy[2]={0,1};

bool dfs(int x,int y){
  cout<<x<<" "<<y<<endl;
  bool ok=false;
  if(x==w-1&&y==h-1){
    return true;
  }else{
    rep(i,2){
      if(maze[y+dy[i]][x+dx[i]]=='#'){
	ok=dfs(x+dx[i],y+dy[i]);
      }
      if(ok)return ok;
    }
  }
  return ok;
}

int main(){
  cin>>h>>w;
  rep(i,h)rep(j,w)cin>>maze[i][j];
  if(dfs(0,0))cout<<"Possible"<<endl;
  else cout<<"Impossible"<<endl;
  return 0;
}
*/

int main(){
  int h,w,cnt=0;
  cin>>h>>w;
  rep(i,h)rep(j,w){
    char c;
    cin>>c;
    if(c=='#')cnt++;
  }
  if(cnt==w+h-1)cout<<"Possible"<<endl;
  else cout<<"Impossible"<<endl;
}

Submission Info

Submission Time
Task A - Shik and Stone
User mkan_0141
Language C++14 (GCC 5.4.1)
Score 200
Code Size 1590 Byte
Status AC
Exec Time 1 ms
Memory 256 KB

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 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