結果
問題 |
No.290 1010
|
ユーザー |
![]() |
提出日時 | 2016-10-31 12:33:35 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 47 ms / 5,000 ms |
コード長 | 318 bytes |
コンパイル時間 | 1,758 ms |
コンパイル使用メモリ | 168,592 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-25 00:02:36 |
合計ジャッジ時間 | 2,932 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> using namespace std; int n; string s; int main() { cin >> n >> s; bool ok = false; for(int i = 1; i < n; i++) { if(s[i - 1] == s[i]) ok = true; } for(int i = 3; i < n; i++) { if(s.substr(i - 3, 2) == s.substr(i - 1, 2)) ok = true; } cout << (ok ? "YES" : "NO") << endl; return 0; }