結果
| 問題 | No.2518 Adjacent Larger |
| コンテスト | |
| ユーザー |
yu_w(ゆ)
|
| 提出日時 | 2023-10-27 21:56:00 |
| 言語 | PyPy3 (7.3.17) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 505 bytes |
| 記録 | |
| コンパイル時間 | 114 ms |
| コンパイル使用メモリ | 85,424 KB |
| 実行使用メモリ | 98,416 KB |
| 最終ジャッジ日時 | 2026-04-12 18:38:05 |
| 合計ジャッジ時間 | 3,135 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 14 WA * 14 |
ソースコード
T=int(input())
for _ in range(T):
N=int(input())
A=list(map(int,input().split()))
now=0
judge=True
allone=True
for i in range(N):
if A[i]==2:
now+=1
allone=False
elif A[i]==0:
now-=1
allone=False
if now>=2 or now<=-2:
judge=False
break
if now!=0:
judge=False
if allone:
judge=False
if judge:
print("Yes")
else:
print("No")
yu_w(ゆ)