結果

問題 No.2518 Adjacent Larger
ユーザー ニックネーム
提出日時 2023-10-27 21:51:41
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
WA  
実行時間 -
コード長 232 bytes
コンパイル時間 237 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 14,728 KB
最終ジャッジ日時 2024-09-25 13:58:38
合計ジャッジ時間 4,235 ms
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    f = sum(a)==n and a!=[1]*n
    for i in range(n):
        if a[i-1]==a[i]==0 or a[i-1]==a[i]==2: f = False
    print("Yes" if f else "No")
0