Submission #00082
ソースコード
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 | #include<stdio.h> int main(){ int h,w,i,j,n; char t[101][101]; int c[101][101]; int p=-1; scanf ( "%d %d" ,&h,&w); for (i=0;i<h;i++){ scanf ( "%s" ,t[i]); } for (i=0;i<h;i++){ //縦 for (j=0;j<w;j++){ //横 if (t[i][j]== 'c' ){ //自分の場所に雲がある c[i][j]=0; p=j; //雲の位置をメモ } else { //雲がない if (p==-1) c[i][j]=-1; //雲がこない else c[i][j]=j-p; } if (j<w-1) printf ( "%d " ,c[i][j]); else printf ( "%d" ,c[i][j]); } p=-1; printf ( "\n" ); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0006 - 気象予報士 (Weather Forecaster) |
ユーザー名 | ei1436 |
投稿日時 | 2015-11-12 18:01:01 |
言語 | C |
状態 | Accepted |
得点 | 100 |
ソースコード長 | 601 Byte |
最大実行時間 | 20 ms |
最大メモリ使用量 | 580 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | IN1 | 20 / 20 | *2015-yo-t3-in1.txt |
2 | IN2 | 20 / 20 | *2015-yo-t3-in2.txt |
3 | IN3 | 20 / 20 | *2015-yo-t3-in3.txt |
4 | IN4 | 20 / 20 | *2015-yo-t3-in4.txt |
5 | IN5 | 20 / 20 | *2015-yo-t3-in5.txt |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | ||||
---|---|---|---|---|---|---|---|---|
2015-yo-t3-in1.txt | AC | 20 ms | 380 KB |
1
|
||||
2015-yo-t3-in2.txt | AC | 14 ms | 532 KB |
2
|
||||
2015-yo-t3-in3.txt | AC | 10 ms | 580 KB |
3
|
||||
2015-yo-t3-in4.txt | AC | 10 ms | 400 KB |
4
|
||||
2015-yo-t3-in5.txt | AC | 11 ms | 536 KB |
5
|