結果
| 問題 | No.290 1010 | 
| コンテスト | |
| ユーザー |  izuru_matsuura | 
| 提出日時 | 2016-06-07 18:20:37 | 
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) | 
| 結果 | 
                                AC
                                 
                             | 
| 実行時間 | 23 ms / 5,000 ms | 
| コード長 | 868 bytes | 
| コンパイル時間 | 1,676 ms | 
| コンパイル使用メモリ | 157,784 KB | 
| 実行使用メモリ | 5,428 KB | 
| 最終ジャッジ日時 | 2024-10-08 18:03:04 | 
| 合計ジャッジ時間 | 2,392 ms | 
| ジャッジサーバーID (参考情報) | judge2 / judge4 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| other | AC * 24 | 
ソースコード
#include <bits/stdc++.h>
using namespace std;
namespace {
    typedef double real;
    typedef long long ll;
    template<class T> ostream& operator<<(ostream& os, const vector<T>& vs) {
        if (vs.empty()) return os << "[]";
        os << "[" << vs[0];
        for (int i = 1; i < vs.size(); i++) os << " " << vs[i];
        return os << "]";
    }
    template<class T> istream& operator>>(istream& is, vector<T>& vs) {
        for (auto it = vs.begin(); it != vs.end(); it++) is >> *it;
        return is;
    }
    int N;
    string S;
    void input() {
        cin >> N >> S;
    }
    bool C() {
        for (int i = 0; i < N - 1; i++) {
            if (S[i] == S[i + 1]) return true;
        }
        return N >= 4;
    }
    void solve() {
        cout << (C() ? "YES" : "NO") << endl;
    }
}
int main() {
    input(); solve();
    return 0;
}
            
            
            
        