結果

問題 No.2518 Adjacent Larger
ユーザー ニックネームニックネーム
提出日時 2023-10-27 21:51:41
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 232 bytes
コンパイル時間 194 ms
コンパイル使用メモリ 11,676 KB
実行使用メモリ 13,956 KB
最終ジャッジ日時 2023-10-27 21:51:46
合計ジャッジ時間 4,081 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
10,008 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 61 ms
10,040 KB
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 125 ms
13,320 KB
testcase_17 AC 85 ms
12,096 KB
testcase_18 AC 86 ms
12,108 KB
testcase_19 AC 75 ms
11,728 KB
testcase_20 AC 99 ms
12,476 KB
testcase_21 AC 128 ms
13,956 KB
testcase_22 AC 126 ms
13,956 KB
testcase_23 AC 127 ms
13,956 KB
testcase_24 AC 117 ms
13,308 KB
testcase_25 AC 122 ms
13,956 KB
testcase_26 AC 123 ms
13,956 KB
testcase_27 AC 126 ms
13,956 KB
testcase_28 AC 127 ms
13,956 KB
権限があれば一括ダウンロードができます

ソースコード

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