結果
| 問題 | No.2343 (l+r)/2 |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-06-09 22:06:42 |
| 言語 | C++11 (gcc 15.3.0 + boost 1.92.0) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 479 bytes |
| 記録 | |
| コンパイル時間 | 787 ms |
| コンパイル使用メモリ | 179,696 KB |
| 実行使用メモリ | 9,932 KB |
| 最終ジャッジ日時 | 2026-10-10 04:01:39 |
| 合計ジャッジ時間 | 2,318 ms |
|
ジャッジサーバーID (参考情報) |
judge4_1 / judge3_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | AC * 4 WA * 10 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
void solve(){
int n;
cin >> n;
int a[n];
int res = 0;
for(int i = 0; i < n; i++){
cin >> a[i];
res++;
}
for(int i = 0; i < n; i++){
if(a[i] == 0 && a[i-1] == 0 && a[i+1] == 0){
n--;
}
if(a[i] == 1 && a[i-1] == 1 && a[i+1] == 1){
n--;
res--;
}
}
if(res * 2 == n){
cout << "Yes" << endl;
}
else{
cout << "No" << endl;
}
}
int main(){
int T;
cin >> T;
while(T--) {
solve();
}
return 0;
}