結果
問題 |
No.290 1010
|
ユーザー |
![]() |
提出日時 | 2017-04-20 16:37:39 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 23 ms / 5,000 ms |
コード長 | 780 bytes |
コンパイル時間 | 1,468 ms |
コンパイル使用メモリ | 165,188 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-07-19 21:08:11 |
合計ジャッジ時間 | 2,783 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 24 |
ソースコード
#include <bits/stdc++.h> #define rep(i,n) for(int i=0;i<(int)(n);i++) #define rep1(i,n) for(int i=1;i<=(int)(n);i++) #define all(c) c.begin(),c.end() #define pb push_back #define fs first #define sc second #define show(x) cout << #x << " = " << x << endl #define chmin(x,y) x=min(x,y) #define chmax(x,y) x=max(x,y) using namespace std; template<class S,class T> ostream& operator<<(ostream& o,const pair<S,T> &p){return o<<"("<<p.fs<<","<<p.sc<<")";} template<class T> ostream& operator<<(ostream& o,const vector<T> &vc){o<<"sz = "<<vc.size()<<endl<<"[";for(const T& v:vc) o<<v<<",";o<<"]";return o;} int solve(){ int N; string s; cin>>N>>s; rep(i,N-1){ if(s[i]==s[i+1]) return 1; } if(N>=4) return 1; return 0; } int main(){ if(solve()) puts("YES"); else puts("NO"); }