結果

問題 No.2343 (l+r)/2
ユーザー lloyzlloyz
提出日時 2023-06-09 21:25:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 411 bytes
コンパイル時間 2,108 ms
コンパイル使用メモリ 86,936 KB
実行使用メモリ 94,952 KB
最終ジャッジ日時 2023-08-30 12:52:43
合計ジャッジ時間 3,339 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,220 KB
testcase_01 AC 605 ms
78,156 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 81 ms
79,172 KB
testcase_06 AC 79 ms
78,296 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 91 ms
90,540 KB
testcase_12 WA -
testcase_13 AC 83 ms
81,948 KB
testcase_14 AC 98 ms
94,952 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n = int(input())
    A = list(map(int, input().split()))
    B = [A[0]]
    for i in range(1, n):
        if A[i] == A[i - 1]:
            continue
        B.append(A[i])
    if B[0] == 1:
        if len(B) == 1:
            print("No")
        else:
            print("Yes")
    else:
        if len(B) % 2 == 0:
            print("Yes")
        else:
            print("No")
0