結果
| 問題 | No.2518 Adjacent Larger |
| コンテスト | |
| ユーザー |
yu_w(ゆ)
|
| 提出日時 | 2023-10-27 21:56:00 |
| 言語 | PyPy3 (7.3.23 + ACL) |
| 結果 |
WA
不安定
|
| 実行時間 | - |
| コード長 | 505 bytes |
| 記録 | |
| コンパイル時間 | 257 ms |
| コンパイル使用メモリ | 95,692 KB |
| 実行使用メモリ | 112,000 KB |
| 最終ジャッジ日時 | 2026-09-04 04:10:35 |
| 合計ジャッジ時間 | 5,694 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_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(ゆ)