Submission #56861
ソースコード
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 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 | #include<bits/stdc++.h> #define rep(i,n) for(int i=0; i<(n); i++) #define reps(i,n) for(int i=1; i<=(n); i++) #define pii pair<int,int> #define gsort(x,n) sort((x),(x)+(n),greater<int>()) #define all(x) (x).begin(), (x).end() #define int long long #define abs(a) llabs(a) #define re(s) reverse((s).begin(),(s).end()) #define setout(n,x) setw(n) << setfill(x) #define Fixed fixed << setprecision(10) const long long mod = 1000000007; using namespace std; signed main() { cin.tie(0); ios::sync_with_stdio( false ); int h,w,cnt=0; string s; cin>>h>>w; int x[1010][1010]; rep(i,h){ cin>>s; bool a = false ; rep(j,w){ if (s[j]== 'c' ){ x[i][j]=0; a= true ; cout<<x[i][j]; } else if (a){ x[i][j]=x[i][j-1]+1; cout<<x[i][j]; } else { x[i][j]=-1; cout<<x[i][j]; } if (j!=w-1) cout<< ' ' ; } cout<< '\n' ; } } |
ステータス
項目 | データ |
---|---|
問題 | 0205 - 気象予報士 (Weather Forecaster) |
ユーザー名 | immunity |
投稿日時 | 2019-12-02 18:41:54 |
言語 | C++11 |
状態 | Accepted |
得点 | 5 |
ソースコード長 | 1100 Byte |
最大実行時間 | 23 ms |
最大メモリ使用量 | 3004 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 | 23 ms | 604 KB |
1
|
||||
2015-yo-t3-in2.txt | AC | 20 ms | 2548 KB |
2
|
||||
2015-yo-t3-in3.txt | AC | 17 ms | 2756 KB |
3
|
||||
2015-yo-t3-in4.txt | AC | 20 ms | 3004 KB |
4
|
||||
2015-yo-t3-in5.txt | AC | 21 ms | 1124 KB |
5
|