Submission #00034
ソースコード
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 | #include<iostream> #include<cstdio> #include<algorithm> using namespace std; int main(){ int n; string w[55]; int t[5]={5,12,17,24,31}; while (1){ scanf ( "%d" ,&n); if (n==0) break ; for ( int i=0;i<n;i++){ cin >> w[i]; } for ( int i=0;i<n;i++){ int f=1; int idx=i; int len=0; for ( int j=0;j<5 && f;j++){ while (1){ len += w[idx].size(); idx++; if (len==t[j]) break ; if (len>t[j]){ f=0; break ; } if (idx>=n) break ; } } if (f){ printf ( "%d\n" ,i+1); break ; } } } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 短句 |
ユーザー名 | ei1410 |
投稿日時 | 2016-03-30 13:34:08 |
言語 | C++11 |
状態 | Accepted |
得点 | 15 |
ソースコード長 | 632 Byte |
最大実行時間 | 14 ms |
最大メモリ使用量 | 556 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 15 / 15 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
B1 | AC | 12 ms | 476 KB |
1
|
B2 | AC | 14 ms | 456 KB |
1
|
B3 | AC | 13 ms | 556 KB |
1
|
B4 | AC | 13 ms | 532 KB |
1
|