Submission #26635


ソースコード

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
#include <bits/stdc++.h>
const int dx[]={0,0,0,1,-1}, dy[]={0,-1,1,0,0};
int mp[64][64];
main(){
int h,w;
int i,j;
int n;
int cnt = 0;
int x,y;
scanf("%d %d", &h, &w);
for(i=0; i<h; ++i){
for(j=0; j<w; ++j){
scanf("%d", &mp[i][j]);
if(mp[i][j] == 4)x=j, y=i;
}
}
scanf("%d", &n);
while(n--){
scanf("%d", &i);
while(mp[ y += dy[i] ][ x += dx[i] ] != 1)
if(mp[y][x] == 3)++cnt, mp[y][x] = 0;
y -= dy[i], x -= dx[i];
}
printf("%d\n", cnt);
}

ステータス

項目 データ
問題 0387 - 回れ雛月花 -Easy
ユーザー名 Arumakan_ei1727
投稿日時 2017-09-09 08:21:22
言語 C++11
状態 Accepted
得点 3
ソースコード長 532 Byte
最大実行時間 27 ms
最大メモリ使用量 552 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
spin_input01 AC 27 ms 480 KB
1
spin_input02 AC 16 ms 452 KB
1
spin_input03 AC 20 ms 552 KB
1
spin_input04 AC 18 ms 528 KB
1
spin_input05 AC 18 ms 496 KB
1