結果

問題 No.2518 Adjacent Larger
ユーザー 👑 rin204rin204
提出日時 2023-10-27 21:32:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 363 bytes
コンパイル時間 155 ms
コンパイル使用メモリ 81,764 KB
実行使用メモリ 100,488 KB
最終ジャッジ日時 2023-10-27 21:32:49
合計ジャッジ時間 3,474 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 31 ms
53,524 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 AC 88 ms
76,232 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 79 ms
100,428 KB
testcase_17 AC 56 ms
82,864 KB
testcase_18 AC 54 ms
82,880 KB
testcase_19 AC 53 ms
80,900 KB
testcase_20 AC 60 ms
89,384 KB
testcase_21 AC 64 ms
95,860 KB
testcase_22 AC 62 ms
95,860 KB
testcase_23 AC 71 ms
100,488 KB
testcase_24 AC 66 ms
98,160 KB
testcase_25 AC 66 ms
98,280 KB
testcase_26 AC 75 ms
98,280 KB
testcase_27 AC 69 ms
98,280 KB
testcase_28 AC 65 ms
98,280 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    A = list(map(int, input().split()))
    if sum(A) != n:
        return False
    for i in range(n):
        if A[i] + A[i - 1] not in [1, 2, 3]:
            return False
    if 0 not in A:
        return False
    return True


for _ in range(int(input())):
    if solve():
        print("Yes")
    else:
        print("No")
0