結果

問題 No.2518 Adjacent Larger
ユーザー tassei903tassei903
提出日時 2023-10-27 22:21:12
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 140 ms / 2,000 ms
コード長 584 bytes
コンパイル時間 161 ms
コンパイル使用メモリ 81,896 KB
実行使用メモリ 117,336 KB
最終ジャッジ日時 2023-10-27 22:21:26
合計ジャッジ時間 3,643 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,528 KB
testcase_01 AC 130 ms
77,396 KB
testcase_02 AC 140 ms
77,660 KB
testcase_03 AC 130 ms
77,396 KB
testcase_04 AC 132 ms
77,396 KB
testcase_05 AC 126 ms
77,396 KB
testcase_06 AC 73 ms
75,628 KB
testcase_07 AC 74 ms
75,632 KB
testcase_08 AC 75 ms
75,632 KB
testcase_09 AC 73 ms
75,636 KB
testcase_10 AC 74 ms
75,628 KB
testcase_11 AC 54 ms
73,304 KB
testcase_12 AC 58 ms
75,116 KB
testcase_13 AC 53 ms
73,136 KB
testcase_14 AC 53 ms
72,776 KB
testcase_15 AC 55 ms
73,668 KB
testcase_16 AC 93 ms
112,832 KB
testcase_17 AC 75 ms
95,252 KB
testcase_18 AC 77 ms
95,264 KB
testcase_19 AC 64 ms
86,376 KB
testcase_20 AC 80 ms
100,472 KB
testcase_21 AC 91 ms
112,848 KB
testcase_22 AC 81 ms
107,056 KB
testcase_23 AC 92 ms
112,848 KB
testcase_24 AC 71 ms
95,752 KB
testcase_25 AC 70 ms
95,872 KB
testcase_26 AC 71 ms
95,872 KB
testcase_27 AC 93 ms
117,336 KB
testcase_28 AC 98 ms
117,336 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
input = lambda :sys.stdin.readline()[:-1]
ni = lambda :int(input())
na = lambda :list(map(int,input().split()))
yes = lambda :print("yes");Yes = lambda :print("Yes");YES = lambda : print("YES")
no = lambda :print("no");No = lambda :print("No");NO = lambda : print("NO")
#######################################################################
for _ in range(ni()):
    n = ni()
    a = [x for x in na() if x != 1]
    if len(a) and len(a)%2 == 0 and (a == [[0,2][i%2] for i in range(len(a))] or a == [[2,0][i%2] for i in range(len(a))]):
        Yes()
    else:
        No()
0