結果
問題 | No.290 1010 |
ユーザー |
![]() |
提出日時 | 2016-05-21 18:55:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 25 ms / 5,000 ms |
コード長 | 334 bytes |
コンパイル時間 | 675 ms |
コンパイル使用メモリ | 65,596 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-10-11 01:12:41 |
合計ジャッジ時間 | 1,949 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <iostream> #include <string> using namespace std; int main() { int n; string s; cin>>n>>s; for(int i=0; i<n-1; ++i) if (s[i]==s[i+1]) { cout<<"YES"<<endl; return 0; } for(int i=0; i<n-3; ++i) if (s[i]==s[i+2] and s[i+1]==s[i+3]) { cout<<"YES"<<endl; return 0; } cout<<"NO"<<endl; }