Submission #00006
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int main(){ int n; int str_size[44]; while (cin >> n , n){ for ( int i=0;i<n;i++){ string str; cin >> str; str_size[i] = str.size(); } int dif[] = {5,7,5,7,7}; int flg = 0; for ( int i=0;i<n;i++){ int now = i; for ( int j=0;j<5;j++){ int cnt = 0; while (dif[j] > cnt && now != n){ cnt += str_size[now]; now++; } if (cnt == dif[j]){ if (j == 4){ cout << i+1 << endl; flg = 1; break ; } } else { break ; } } if (flg == 1){ break ; } } } } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 短句 |
ユーザー名 | ei1428 |
投稿日時 | 2016-03-30 13:12:40 |
言語 | C++11 |
状態 | Accepted |
得点 | 15 |
ソースコード長 | 624 Byte |
最大実行時間 | 29 ms |
最大メモリ使用量 | 604 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 15 / 15 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
B1 | AC | 29 ms | 604 KB |
1
|
B2 | AC | 14 ms | 444 KB |
1
|
B3 | AC | 12 ms | 544 KB |
1
|
B4 | AC | 13 ms | 524 KB |
1
|