結果

問題 No.2518 Adjacent Larger
ユーザー KudeKude
提出日時 2023-10-27 21:36:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 181 ms / 2,000 ms
コード長 266 bytes
コンパイル時間 816 ms
コンパイル使用メモリ 81,612 KB
実行使用メモリ 104,428 KB
最終ジャッジ日時 2023-10-27 21:36:46
合計ジャッジ時間 4,056 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
53,452 KB
testcase_01 AC 181 ms
76,944 KB
testcase_02 AC 153 ms
76,976 KB
testcase_03 AC 147 ms
77,240 KB
testcase_04 AC 161 ms
76,976 KB
testcase_05 AC 160 ms
76,980 KB
testcase_06 AC 99 ms
76,184 KB
testcase_07 AC 96 ms
76,280 KB
testcase_08 AC 99 ms
76,200 KB
testcase_09 AC 98 ms
76,344 KB
testcase_10 AC 95 ms
76,224 KB
testcase_11 AC 58 ms
75,192 KB
testcase_12 AC 60 ms
75,332 KB
testcase_13 AC 59 ms
75,228 KB
testcase_14 AC 57 ms
73,684 KB
testcase_15 AC 57 ms
75,240 KB
testcase_16 AC 92 ms
96,400 KB
testcase_17 AC 73 ms
88,588 KB
testcase_18 AC 70 ms
88,076 KB
testcase_19 AC 72 ms
86,548 KB
testcase_20 AC 79 ms
91,432 KB
testcase_21 AC 85 ms
96,680 KB
testcase_22 AC 86 ms
96,680 KB
testcase_23 AC 87 ms
96,416 KB
testcase_24 AC 59 ms
82,224 KB
testcase_25 AC 59 ms
82,276 KB
testcase_26 AC 57 ms
82,276 KB
testcase_27 AC 72 ms
99,508 KB
testcase_28 AC 81 ms
104,428 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    n = int(input())
    a = list(filter(lambda x: x != 1, map(int, input().split())))
    if not a or len(a) % 2:
        return False
    return a == [a[0], 2 - a[0]] * (len(a) // 2)

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