Submission #00041
ソースコード
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 | #include<bits/stdc++.h> using namespace std; int main(){ int n; string str[40]; int len[40]; int r[]={5,12,17,24,31,0}; int ans; while (cin>>n,n){ for ( int i=0;i<n;i++){ cin>>str[i]; len[i]=str[i].size(); } for ( int i=0;i<n;i++){ ans=i+1; int j=0; int ansf=0; int temp=0; int k=i; while (1){ if (temp==r[j])j++; if (j==5)ansf=1; if (temp>r[j]) break ; temp+=len[k]; k++; } if (ansf) break ; } cout<<ans<<endl; } } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 短句 |
ユーザー名 | ei1501 |
投稿日時 | 2016-03-30 13:45:30 |
言語 | C++11 |
状態 | Accepted |
得点 | 15 |
ソースコード長 | 538 Byte |
最大実行時間 | 14 ms |
最大メモリ使用量 | 524 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 15 / 15 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
B1 | AC | 13 ms | 476 KB |
1
|
B2 | AC | 13 ms | 448 KB |
1
|
B3 | AC | 14 ms | 420 KB |
1
|
B4 | AC | 13 ms | 524 KB |
1
|