結果

問題 No.290 1010
ユーザー sggkshio
提出日時 2016-11-24 01:44:39
言語 C++11(廃止可能性あり)
(gcc 13.3.0)
結果
WA  
実行時間 -
コード長 510 bytes
コンパイル時間 610 ms
コンパイル使用メモリ 80,924 KB
実行使用メモリ 5,428 KB
最終ジャッジ日時 2024-11-27 10:29:17
合計ジャッジ時間 1,408 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 22 WA * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#define _USE_MATH_DEFINES
#include<stdio.h>
#include<string>
#include<iostream>
#include<cctype>
#include<cstdio>
#include<vector>
#include<stack>
#include<queue>
#include <algorithm>
#include<math.h>
#include<set>
#include<map>
#include<iomanip>

//#include<bits/stdc++.h>



using namespace std;




int main() {
	
	int x=0,y=0;
	int n;
	string p;
	cin>>n>>p;
	for(int i=0;i<n;i++){
		if(p[i]=='0')x++;
		else y++;
		if(x>1||y>1){
			cout<<"YES"<<endl;
			return 0;
		}
	}
	cout<<"NO"<<endl;

	return 0;
}

	
0