結果
| 問題 | No.290 1010 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2016-06-07 18:04:28 |
| 言語 | C++11 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 5,000 ms |
| コード長 | 393 bytes |
| 記録 | |
| コンパイル時間 | 544 ms |
| コンパイル使用メモリ | 76,912 KB |
| 実行使用メモリ | 6,400 KB |
| 最終ジャッジ日時 | 2026-04-25 01:18:05 |
| 合計ジャッジ時間 | 2,073 ms |
|
ジャッジサーバーID (参考情報) |
judge3_1 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <iostream>
#include <string>
#include <vector>
#include <algorithm>
using namespace std;
int main(void) {
int N; cin >> N;
string s; cin >> s;
if (N >= 4) {
cout << "YES" << endl;
return 0;
}
if (N <= 3) {
bool f = false;;
for (int i = 0; i < N-1; ++i) {
f = (f | (s[i] == s[i + 1]));
}
if (f) cout << "YES" << endl;
else cout << "NO" << endl;
}
return 0;
}