Submission #00061
ソースコード
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 | #include<bits/stdc++.h> using namespace std; #define INF 0xfffffff typedef long long ll; typedef pair< int , int > P; int main(){ int n,cnt; int num[5]={5,7,5,7,7}; while (cin>>n && n){ string str[n]; string temp; string s; for ( int i=0;i<n;i++) cin>>str[i]; for ( int i=0;i<n-4;i++){ cnt=0; for ( int j=i;j<n && cnt<5;j++){ temp+=str[j]; if (temp.size()>num[cnt]){ temp=s; break ; } else if (temp.size()==num[cnt]) { cnt++; string s; temp=s; } } if (cnt==5){ cout<<i+1<<endl; break ; } } } return 0; } |
ステータス
項目 | データ |
---|---|
問題 | 0002 - 短句 |
ユーザー名 | ei1538 |
投稿日時 | 2016-03-30 14:19:02 |
言語 | C++11 |
状態 | Accepted |
得点 | 15 |
ソースコード長 | 622 Byte |
最大実行時間 | 14 ms |
最大メモリ使用量 | 476 KB |
セット
セット | 得点 | Cases | |
---|---|---|---|
1 | ALL | 15 / 15 | * |
テストケース
ファイル名 | 状態 | 実行時間 | メモリ使用量 | # |
---|---|---|---|---|
B1 | AC | 14 ms | 476 KB |
1
|
B2 | AC | 13 ms | 452 KB |
1
|
B3 | AC | 13 ms | 432 KB |
1
|
B4 | AC | 13 ms | 408 KB |
1
|