結果

問題 No.2343 (l+r)/2
ユーザー 👑 SPD_9X2SPD_9X2
提出日時 2023-06-16 09:54:09
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 631 bytes
コンパイル時間 361 ms
コンパイル使用メモリ 86,900 KB
実行使用メモリ 95,524 KB
最終ジャッジ日時 2023-09-06 09:40:57
合計ジャッジ時間 3,354 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,244 KB
testcase_01 AC 185 ms
77,980 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 90 ms
87,032 KB
testcase_05 AC 76 ms
78,704 KB
testcase_06 AC 81 ms
77,956 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 AC 90 ms
86,976 KB
testcase_13 AC 86 ms
82,048 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] != A[-1]:
        print ("Yes")
    else:

        flag = True

        f = A[-1]
        while A and A[-1] == f:
            del A[-1]

        A.reverse()
        while A and A[-1] == f:
            del A[-1]

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

        if N >= 9:
            flag = True

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