Submission #00003


ソースコード

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
#include <iostream>
#include <string>
#include <stack>
#include <queue>
#include <cstring>
#include <algorithm>
#include <vector>
//#include <cstdio>
#include <cmath>
#include <cstdlib>
#include <functional>
using namespace std;
#define elif else if
#define echo cout <<
#define read cin >>
#define fin << '\n'
#define finn cout << '\n'
typedef long long llong;
typedef bool boolean;
typedef pair<int,int> pii;
const int dx[] = {1, 0, -1, 0, 1, 1, -1, -1};
const int dy[] = {0, 1, 0, -1, 1, -1, 1, -1};
boolean canMove(int x,int y,int w,int h){return (x>=0&&y>=0&&x<w&&y<h);};
const int INF = 1 << 29;
char mas[101][101];
int x, y;
int main(){
cin.tie(0); ios::sync_with_stdio(false);
int h, w;
read h >> w;
for ( int i = 0; i < h; i++ ) {
read mas[i];
for ( int j = 0; j < w; j++ ) {
if ( mas[i][j] == '@' ) {
x = j;
y = i;
}
}
}
for ( int i = 0; i < 8; i++ ) {
mas[y+dy[i]][x+dx[i]] = '.';
}
for ( int i = 0; i < h; i++ ) {
for ( int j = 0; j < w; j++ ) {
echo mas[i][j];
}
finn;
}
return 0;
}

ステータス

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

セット

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

テストケース

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