結果
問題 | No.290 1010 |
ユーザー |
![]() |
提出日時 | 2015-10-16 22:38:34 |
言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
結果 |
AC
|
実行時間 | 22 ms / 5,000 ms |
コード長 | 483 bytes |
コンパイル時間 | 787 ms |
コンパイル使用メモリ | 57,004 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-21 19:37:46 |
合計ジャッジ時間 | 1,404 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <iostream>#include <string>using namespace std;int main() {int N;string str;cin >>N>> str;for(int len = 0; len < 2; len++){for(int i = 0; i+len+len+1 <N ; i++){int j=i+len+1;bool f=true;for(int k = 0; k <= len; k++){f&=(str[i+k]==str[j+k]);}if(f){cout<<"YES"<<endl;return 0;}}}cout<<"NO"<<endl;return 0;}