Submission #01740


ソースコード

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<iostream>
#include<cstdio>
using namespace std;
int h,w;
char mapp[105][105];
int main(){
scanf("%d%d",&h,&w);
for(int i=0;i<h;i++)scanf("%s",mapp[i]);
for(int i=0;i<h;i++){//縦
int cz=-1;//czリセット
for(int j=0;j<w;j++){//横
if(mapp[i][j]=='c')cz=j;//czを上書き(雲の座標)
int ans=-1;//雲が通らないときは-1をそのまま出力
if(cz!=-1)ans=j-cz;//j(今見ている座標)-cz(雲があった座標)=経過時間
if(j==w-1)printf("%d",ans);
else printf("%d ",ans);
}
printf("\n");
}
}

ステータス

項目 データ
問題 0205 - 気象予報士 (Weather Forecaster)
ユーザー名 ei1528
投稿日時 2015-11-16 08:23:59
言語 C++11
状態 Accepted
得点 5
ソースコード長 629 Byte
最大実行時間 14 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 12 ms 476 KB
1
2015-yo-t3-in2.txt AC 13 ms 448 KB
2
2015-yo-t3-in3.txt AC 14 ms 540 KB
3
2015-yo-t3-in4.txt AC 13 ms 512 KB
4
2015-yo-t3-in5.txt AC 11 ms 604 KB
5