Submission #00022


ソースコード

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
#include <iostream>
using namespace std;
int main()
{
int h,w;
char mp[105][105];
cin>>h>>w;
for(int i=0;i<h;++i){
for(int j=0;j<w;++j){
cin>>mp[i][j];
}
}
for(int i=0;i<h;++i){
for(int j=0;j<w;++j){
if(mp[i][j]=='@'){
if(j+1<w){
mp[i][j+1]='.';
}
if(j-1>=0){
mp[i][j-1]='.';
}
if(i+1<h){
mp[i+1][j]='.';
}
if(i-1>=0){
mp[i-1][j]='.';
}
if(i+1<h&&j-1>=0){
mp[i+1][j-1]='.';
}
if(i+1<h&&j+1<w){
mp[i+1][j+1]='.';
}
if(i-1>=0&&j-1>=0){
mp[i-1][j-1]='.';
}
if(i-1>=0&&j+1<w){
mp[i-1][j+1]='.';
}
}
}
}
for(int i=0;i<h;++i){
for(int j=0;j<w;++j){
cout<<mp[i][j];
}
cout<<'\n';
}
return 0;
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.dat AC 21 ms 480 KB
1
in02.dat AC 20 ms 452 KB
1
in03.dat AC 25 ms 424 KB
1
in04.dat AC 25 ms 396 KB
1
in05.dat AC 19 ms 364 KB
1
in06.dat AC 25 ms 468 KB
1