Submission #00153
ソースコード
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 | #include<bits/stdc++.h> using namespace std; const int dx[]={0,1,0,-1}, dy[]={1,0,-1,0}; struct P{ int x,y,r; }; int h,w,sx,sy,gx,gy,n; char mp[1030][1030]; char hoge= 'A' ; int toN( const char & c){ return c- '0' ;} void wow( int , int ); void barn( int x, int y, int r){ for ( int i=y-r; i<=y+r; ++i){ for ( int j=x-r; j<=x+r; ++j){ mp[i][j]= '.' ; } } return ; } main(){ int i,j,tmp; vector <P> bombs; cin >> h >> w; h+=10,w+=10; for (i=10;i<h;++i){ for (j=10;j<w;++j){ cin >> mp[i][j]; if ((tmp=toN(mp[i][j]))<10 && tmp>=0)bombs.push_back((P){j,i,tmp}); } } for (i=0;i<bombs.size();++i){ P &p=bombs[i]; barn(p.x, p.y, p.r); } for (i=10;i<h;++i){ for (j=10;j<w;++j){ if (mp[i][j]== '.' ){ wow(j,i); ++hoge; } } } cin>> n; for (i=0;i<n;++i){ cin >> sx >> sy >> gx >> gy; sx+=10,sy+=10,gx+=10,gy+=10; if (mp[sy][sx]!= '#' && mp[gy][gx]!= '#' && mp[sy][sx]==mp[gy][gx]) puts ( "yes" ); else puts ( "no" ); } return 0; } void wow( int x, int y){ mp[y][x]=hoge; for ( int i=0;i<4;++i){ int nx=x+dx[i], ny=y+dy[i]; if (mp[ny][nx]== '.' )wow(nx,ny); } return ; } |
ステータス
項目 | データ |
---|---|
問題 | 0004 - 韓流ハゲ |
ユーザー名 | Mintows |
投稿日時 | 2017-08-08 11:39:21 |
言語 | C++11 |
状態 | Memory Limit Exceeded |
得点 | 0 |
ソースコード長 | 1225 Byte |
最大実行時間 | 1000 ms |
最大メモリ使用量 | 65536 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 60 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
in00.dat | AC | 14 ms | 476 KB |
1
|
in01.dat | AC | 14 ms | 676 KB |
1
|
in02.dat | AC | 17 ms | 576 KB |
1
|
in03.dat | AC | 13 ms | 1160 KB |
1
|
in04.dat | AC | 18 ms | 1028 KB |
1
|
in05.dat | AC | 15 ms | 1180 KB |
1
|
in06.dat | AC | 24 ms | 1564 KB |
1
|
in07.dat | MLE | 1000 ms | 65536 KB |
1
|
in08.dat | MLE | 1000 ms | 65536 KB |
1
|
in09.dat | AC | 60 ms | 16760 KB |
1
|
in10.dat | AC | 65 ms | 19052 KB |
1
|
in11.dat | AC | 63 ms | 17780 KB |
1
|
in12.dat | AC | 62 ms | 16492 KB |
1
|
in13.dat | AC | 62 ms | 17572 KB |
1
|
in14.dat | AC | 66 ms | 17460 KB |
1
|
in15.dat | AC | 80 ms | 18472 KB |
1
|