Submission #00059
ソースコード
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 | #include<iostream> #include<cstdio> #include<cstring> #include<cmath> using namespace std; int main(){ int i,j,k; int n; int ans=0; int tmp; char buff[256]; int num[41]; int box[5] = {5,7,5,7,7}; scanf ( "%d" ,&n); while (n != 0){ for (i=0;i<n;i++){ scanf ( "%s" ,buff); num[i] = strlen (buff); } i=0; j=0; k=0; while (i < n-5){ tmp = num[i]; j=i; k=0; while (tmp <= box[k] && k < 5){ j++; if (tmp == box[k]){ tmp = num[j]; k++; } else { tmp += num[j]; } } if (k == 5){ ans = i+1; i = 100000; } i++; } printf ( "%d\n" ,ans); scanf ( "%d" ,&n); } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 短句 |
ユーザー名 | ei1401 |
投稿日時 | 2016-03-30 14:18:11 |
言語 | C++ |
状態 | Wrong Answer |
得点 | 0 |
ソースコード長 | 720 Byte |
最大実行時間 | 13 ms |
最大メモリ使用量 | 660 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 0 / 15 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
B1 | WA | 12 ms | 476 KB |
1
|
B2 | WA | 13 ms | 452 KB |
1
|
B3 | WA | 11 ms | 556 KB |
1
|
B4 | WA | 13 ms | 660 KB |
1
|