結果
問題 |
No.290 1010
|
ユーザー |
![]() |
提出日時 | 2017-05-04 11:10:12 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 370 bytes |
コンパイル時間 | 1,640 ms |
コンパイル使用メモリ | 167,372 KB |
実行使用メモリ | 5,424 KB |
最終ジャッジ日時 | 2024-09-14 06:53:42 |
合計ジャッジ時間 | 2,505 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define REP(i,n,N) for(int i=(n);i<(int)N;i++) #define p(s) cout<<(s)<<endl using namespace std; int main(){ int N; string S; cin>>N>>S; string ans="NO"; if(N>3) ans="YES"; else{ REP(i,1,N+1){ REP(j,i,N+1){ if(2*j-i>N) break; if(S.substr(i-1,j-i+1)==S.substr(j,j-i+1)){ ans="YES"; } } } } p(ans); return 0; }