Submission #00040


ソースコード

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<bits/stdc++.h>
using namespace std;
int main(){
int n, i, j, len, flag, num[5] = {5, 7, 5, 7, 7};
string w[40];
while(cin >> n, n){
for(i = 0; i < n; i++) cin >> w[i];
for(i = 0; i < n; i++){
len = 0;
j = i;
flag = 0;
while(j < n){
len += w[j].size();
if(len == num[flag]){
len = 0;
flag++;
}
else if(len > num[flag]){
break;
}
j++;
}
if(flag == 5) break;
}
cout << i+1 << endl;
}
}

ステータス

項目 データ
問題 0002 - 短句
ユーザー名 ei1409
投稿日時 2016-03-30 13:42:57
言語 C++
状態 Accepted
得点 15
ソースコード長 502 Byte
最大実行時間 15 ms
最大メモリ使用量 560 KB

セット

セット 得点 Cases
1 ALL 15 / 15 *

テストケース

ファイル名 状態 実行時間 メモリ使用量 #
B1 AC 15 ms 476 KB
1
B2 AC 12 ms 456 KB
1
B3 AC 12 ms 560 KB
1
B4 AC 12 ms 536 KB
1