結果
問題 | No.2518 Adjacent Larger |
ユーザー |
![]() |
提出日時 | 2023-10-27 21:35:53 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 423 bytes |
コンパイル時間 | 310 ms |
コンパイル使用メモリ | 82,376 KB |
実行使用メモリ | 98,080 KB |
最終ジャッジ日時 | 2024-09-25 13:40:41 |
合計ジャッジ時間 | 3,387 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 13 WA * 15 |
ソースコード
import sysinput = sys.stdin.readlineT = int(input())for _ in range(T):N = int(input())A = list(map(int, input().split()))if 2 not in A or 0 not in A:print("No")continueA.append(A[0])flag = 1for i in range(N):if A[i] == A[i + 1]:if A[i] == 0 or A[i] == 2:flag = 0breakprint("Yes") if flag else print("No")