結果
| 問題 |
No.2518 Adjacent Larger
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2023-10-27 21:49:26 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 530 bytes |
| コンパイル時間 | 2,148 ms |
| コンパイル使用メモリ | 195,020 KB |
| 最終ジャッジ日時 | 2025-02-17 14:52:25 |
|
ジャッジサーバーID (参考情報) |
judge1 / judge5 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 13 WA * 15 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
void solve(){
int N;
cin>>N;
vector A(N,0);
for(int &i:A)cin>>i;
if(*max_element(A.begin(),A.end())!=2||*min_element(A.begin(),A.end())!=0){
puts("No");
return;
}
for(int i=0;i<N;i++){
if(A[i]==2&&A[(i+1)%N]==2||(A[i]==0&&A[(i+1)%N]==0)){
puts("No");
return;
}
}
puts("Yes");
}
int main(){
ios::sync_with_stdio(false);
cin.tie(nullptr);
int test_case;
cin>>test_case;
while (test_case--){
solve();
}
}