結果

問題 No.290 1010
ユーザー mencotton
提出日時 2020-11-02 23:24:07
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 25 ms / 5,000 ms
コード長 376 bytes
コンパイル時間 677 ms
コンパイル使用メモリ 69,200 KB
実行使用メモリ 5,428 KB
最終ジャッジ日時 2024-07-22 08:19:33
合計ジャッジ時間 1,534 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 24
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;
using ll = long long;

int main() {
    int n;
    string s;
    cin >> n >> s;

    bool contains = false;
    for (int i = 0; i < n - 1; i++) {
        if (s[i] == s[i + 1])contains = true;
    }

    if (n >= 4 || contains)cout << "YES" << endl;
    else cout << "NO" << endl;
    return 0;
}
0