Submission #53513
ソースコード
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 | #include<iostream> #include<algorithm> using namespace std; int main( void ){ char sky[110][110]; int h,w,sum[110],weather[110][110]={}; cin>>h>>w; for ( int i=1;i<=h;i++){ sum[i]=-1; for ( int j=1;j<=w;j++){ cin>>sky[i][j]; if (sky[i][j]== 'c' ){ sum[i]=0; weather[i][j]=sum[i]; } else if (sum[i]!=-1){ sum[i]++; weather[i][j]=sum[i]; } else weather[i][j]=sum[i]; } } for ( int i=1;i<=h;i++){ for ( int j=1;j<=w;j++){ cout<<weather[i][j]; if (j==w) cout<< '\n' ; else cout<< " " ; } } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0205 - 気象予報士 (Weather Forecaster) |
ユーザー名 | NASSUN_ei1906 |
投稿日時 | 2019-08-23 16:13:46 |
言語 | C++ |
状態 | Accepted |
得点 | 5 |
ソースコード長 | 571 Byte |
最大実行時間 | 28 ms |
最大メモリ使用量 | 604 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | IN1 | 1 / 1 | *2015-yo-t3-in1.txt |
2 | IN2 | 1 / 1 | *2015-yo-t3-in2.txt |
3 | IN3 | 1 / 1 | *2015-yo-t3-in3.txt |
4 | IN4 | 1 / 1 | *2015-yo-t3-in4.txt |
5 | IN5 | 1 / 1 | *2015-yo-t3-in5.txt |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # | ||||
---|---|---|---|---|---|---|---|---|
2015-yo-t3-in1.txt | AC | 28 ms | 604 KB |
1
|
||||
2015-yo-t3-in2.txt | AC | 18 ms | 404 KB |
2
|
||||
2015-yo-t3-in3.txt | AC | 20 ms | 448 KB |
3
|
||||
2015-yo-t3-in4.txt | AC | 23 ms | 488 KB |
4
|
||||
2015-yo-t3-in5.txt | AC | 26 ms | 532 KB |
5
|