結果

問題 No.290 1010
コンテスト
ユーザー latte0119
提出日時 2015-10-16 23:59:26
言語 C++11
(gcc 15.3.0 + boost 1.92.0)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=gnu++11 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
AC  
実行時間 4 ms / 5,000 ms
+ 195µs
コード長 461 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,192 ms
コンパイル使用メモリ 175,232 KB
実行使用メモリ 9,924 KB
最終ジャッジ日時 2026-10-28 20:31:26
合計ジャッジ時間 2,466 ms
ジャッジサーバーID
(参考情報)
judge1_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 25
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include<bits/stdc++.h>
using namespace std;
typedef pair<int,int>P;
typedef vector<int>VI;
#define rep(i,n) for(int i=0;i<(n);i++)
#define pb push_back
#define all(v) (v).begin(),(v).end()

int N;
char str[1010101];

int main(){
    scanf("%d%s",&N,str);
    for(int i=0;i<N-1;i++){
        if(str[i]==str[i+1]){
            cout<<"YES"<<endl;
            return 0;
        }
    }
    
    if(N>=4)cout<<"YES"<<endl;
    else cout<<"NO"<<endl;
    return 0;
}
0