結果

問題 No.2343 (l+r)/2
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-16 09:58:49
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 549 bytes
コンパイル時間 324 ms
コンパイル使用メモリ 87,040 KB
実行使用メモリ 94,992 KB
最終ジャッジ日時 2023-09-06 09:45:10
合計ジャッジ時間 3,207 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,260 KB
testcase_01 AC 242 ms
79,388 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 93 ms
87,116 KB
testcase_05 AC 82 ms
78,396 KB
testcase_06 AC 89 ms
78,320 KB
testcase_07 WA -
testcase_08 AC 98 ms
77,904 KB
testcase_09 AC 91 ms
77,688 KB
testcase_10 WA -
testcase_11 AC 96 ms
90,700 KB
testcase_12 AC 91 ms
86,956 KB
testcase_13 AC 89 ms
82,292 KB
testcase_14 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
from sys import stdin

TT = int(stdin.readline())

for loop in range(TT):

    N = int(stdin.readline())
    A = list(map(int,stdin.readline().split()))

    if A[0] == 1:
        for i in range(N):
            A[i] ^= 1
        

    if A[0] != A[-1]:
        print ("Yes")
    else:

        flag = False
        for i in range(len(A)-1):
            if A[i] == A[i+1] == 1:
                flag = True

        if sum(A) >= 3:
            flag = True

        if flag:
            print ("Yes")
        else:
            print ("No")
0