結果
| 問題 |
No.2518 Adjacent Larger
|
| コンテスト | |
| ユーザー |
timi
|
| 提出日時 | 2023-10-28 18:42:11 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 269 bytes |
| コンパイル時間 | 232 ms |
| コンパイル使用メモリ | 82,508 KB |
| 実行使用メモリ | 98,832 KB |
| 最終ジャッジ日時 | 2024-09-25 16:32:26 |
| 合計ジャッジ時間 | 3,650 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 WA * 14 |
ソースコード
T=int(input())
for _ in range(T):
N=int(input())
A=list(map(int, input().split()))
f=1
if A.count(0)==0 or A.count(2)==0 or sum(A)!=N:
f=0
for i in range(N):
if A[i-1]==A[i] and A[i]!=1:
f=0
if f==1:
print('Yes')
else:
print('No')
timi