結果

問題 No.2343 (l+r)/2
ユーザー ニックネーム
提出日時 2023-06-09 21:54:49
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 1,891 ms / 2,000 ms
コード長 287 bytes
コンパイル時間 291 ms
コンパイル使用メモリ 12,416 KB
実行使用メモリ 12,560 KB
最終ジャッジ日時 2025-01-02 02:54:58
合計ジャッジ時間 3,965 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 14
権限があれば一括ダウンロードができます

ソースコード

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