結果

問題 No.2343 (l+r)/2
ユーザー ニックネームニックネーム
提出日時 2023-06-09 21:54:49
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
AC  
実行時間 1,718 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 166 ms
コンパイル使用メモリ 10,728 KB
実行使用メモリ 10,484 KB
最終ジャッジ日時 2023-08-30 13:12:13
合計ジャッジ時間 3,416 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 17 ms
7,804 KB
testcase_01 AC 1,718 ms
7,972 KB
testcase_02 AC 27 ms
7,880 KB
testcase_03 AC 211 ms
7,968 KB
testcase_04 AC 46 ms
10,252 KB
testcase_05 AC 28 ms
8,916 KB
testcase_06 AC 25 ms
8,788 KB
testcase_07 AC 37 ms
8,668 KB
testcase_08 AC 44 ms
8,844 KB
testcase_09 AC 34 ms
8,764 KB
testcase_10 AC 23 ms
8,580 KB
testcase_11 AC 44 ms
10,036 KB
testcase_12 AC 38 ms
9,492 KB
testcase_13 AC 30 ms
9,064 KB
testcase_14 AC 52 ms
10,484 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

for _ in range(int(input())):
    n = int(input())
    a = list(map(int,input().split()))
    ans = "Yes" if a[0]!=a[-1] else "No"
    b = [i for i in range(n) if a[i]!=a[0]]
    if len(b)>3: ans = "Yes"
    for i in range(len(b)-1):
        if b[i]+1==b[i+1]: ans = "Yes"
    print(ans)
0