結果
| 問題 |
No.290 1010
|
| コンテスト | |
| ユーザー |
smiken_61
|
| 提出日時 | 2015-10-21 08:19:59 |
| 言語 | C++11(廃止可能性あり) (gcc 13.3.0) |
| 結果 |
AC
|
| 実行時間 | 21 ms / 5,000 ms |
| コード長 | 409 bytes |
| コンパイル時間 | 471 ms |
| コンパイル使用メモリ | 58,736 KB |
| 実行使用メモリ | 6,944 KB |
| 最終ジャッジ日時 | 2024-07-22 11:08:44 |
| 合計ジャッジ時間 | 1,476 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 24 |
ソースコード
#include <iostream>
#include <algorithm>
#include <stdlib.h>
#include <string>
using namespace std;
int main() {
int n,ans;
string s;
cin>>n;
cin>>s;
if(n>3) ans=1;
if(n==3){
if(s=="000" ||s=="001" ||s=="011" ||s=="100" ||s=="110" ||s=="111") ans =1;
else ans= 0;
}
if(n==2){
if(s=="00" || s=="11") ans=1;
else ans=0;
}
if(n==1) ans=0;
if(ans==0) cout<<"NO"<<endl;
else cout<<"YES"<<endl;
return 0;
}
smiken_61