Submission #00010


ソースコード

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
#include<bits/stdc++.h>
using namespace std;
int main(){
cin.tie(0);
ios::sync_with_stdio(false);
int h,w;
int ypos,xpos;
char maps[101][101];
cin >> h >> w;
for(int i = 0;i < h;i++){
for(int j = 0;j < w;j++){
cin >> maps[i][j];
if(maps[i][j] == '@'){
ypos = i - 1;
xpos = j - 1;
}
}
}
for(int i = 0;i < 3;i++){
for(int j = 0;j < 3;j++){
int nx = xpos + j;
int ny = ypos + i;
if(nx >= 0 && nx < w && ny >= 0 && ny < h && maps[ny][nx] != '@'){
maps[ny][nx] = '.';
}
}
}
for(int i = 0;i < h;i++){
for(int j = 0;j < w;j++){
cout << maps[i][j];
}
cout << endl;
}
return 0;
}

ステータス

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

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
in01.dat AC 23 ms 480 KB
1
in02.dat AC 26 ms 436 KB
1
in03.dat AC 24 ms 516 KB
1
in04.dat AC 23 ms 724 KB
1
in05.dat AC 24 ms 548 KB
1
in06.dat AC 21 ms 636 KB
1