Submission #14157


ソースコード

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
dx[5]={0,-1,1,0,0};
dy[5]={0,0,0,1,-1};
a[60][60];h,w,n,cnt,x,y,t;
main(){
scanf("%d%d",&h,&w);
for(int i=0;i<h;i++)for(int j=0;j<w;j++)scanf("%d",&a[i][j]),a[i][j]==4?x=i,y=j:0;
scanf("%d",&n);
while(n--){
scanf("%d",&t);
while(a[x+dx[t]][y+dy[t]]!=1){
x+=dx[t];y+=dy[t];
if(a[x][y]==3)a[x][y]=0,cnt++;
}
}
printf("%d\n",cnt);
}

ステータス

項目 データ
問題 0387 - 回れ雛月花 -Easy
ユーザー名 sugar
投稿日時 2017-04-08 12:03:57
言語 C
状態 Accepted
得点 3
ソースコード長 351 Byte
最大実行時間 65 ms
最大メモリ使用量 536 KB

セット

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

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
spin_input01 AC 65 ms 380 KB
1
spin_input02 AC 29 ms 412 KB
1
spin_input03 AC 27 ms 472 KB
1
spin_input04 AC 19 ms 536 KB
1
spin_input05 AC 16 ms 492 KB
1