結果
| 問題 |
No.290 1010
|
| コンテスト | |
| ユーザー |
latte0119
|
| 提出日時 | 2015-10-16 23:59:26 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 6 ms / 5,000 ms |
| コード長 | 461 bytes |
| コンパイル時間 | 1,105 ms |
| コンパイル使用メモリ | 157,616 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-22 06:44:54 |
| 合計ジャッジ時間 | 1,875 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
コンパイルメッセージ
main.cpp: In function ‘int main()’:
main.cpp:13:10: warning: ignoring return value of ‘int scanf(const char*, ...)’ declared with attribute ‘warn_unused_result’ [-Wunused-result]
13 | scanf("%d%s",&N,str);
| ~~~~~^~~~~~~~~~~~~~~
ソースコード
#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;
}
latte0119