Submission #00017


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
int main(){
int h,w,ax,ay;
int dx[]={1,0,-1,-1,-1,0,1,1};
int dy[]={1,1,1,0,-1,-1,-1,0};
char mp[111][111];
cin>>h>>w;
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
cin>>mp[i][j];
if(mp[i][j]=='@'){
ax=j; ay=i;
}
}
}
for(int i=0;i<8;i++){
int nx=ax+dx[i],ny=ay+dy[i];
if(nx>=0&&nx<w&&ny>=0&&ny<h){
mp[ny][nx]='.';
}
}
for(int i=0;i<h;i++){
for(int j=0;j<w;j++){
cout<<mp[i][j];
}
cout<<endl;
}
return(0);
}

ステータス

項目 データ
問題 0001 - 中華ハゲ
ユーザー名 r1732
投稿日時 2018-08-22 10:20:56
言語 C++11
状態 Accepted
得点 10
ソースコード長 567 Byte
最大実行時間 30 ms
最大メモリ使用量 484 KB

セット

セット 得点 Cases
1 ALL 10 / 10 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.dat AC 25 ms 476 KB
1
in02.dat AC 18 ms 448 KB
1
in03.dat AC 25 ms 412 KB
1
in04.dat AC 30 ms 384 KB
1
in05.dat AC 15 ms 484 KB
1
in06.dat AC 24 ms 452 KB
1