結果

問題 No.2343 (l+r)/2
ユーザー flygonflygon
提出日時 2023-06-09 21:49:54
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 700 bytes
コンパイル時間 1,017 ms
コンパイル使用メモリ 87,088 KB
実行使用メモリ 96,580 KB
最終ジャッジ日時 2023-08-30 13:09:52
合計ジャッジ時間 3,893 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 94 ms
71,544 KB
testcase_01 AC 236 ms
79,252 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 117 ms
91,400 KB
testcase_05 AC 105 ms
80,604 KB
testcase_06 AC 107 ms
79,576 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 AC 104 ms
78,780 KB
testcase_11 AC 116 ms
92,104 KB
testcase_12 WA -
testcase_13 WA -
testcase_14 AC 121 ms
96,580 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys
sys.setrecursionlimit(5*10**5)
input = sys.stdin.readline
from collections import defaultdict, deque, Counter
from heapq import heappop, heappush
from bisect import bisect_left, bisect_right
from math import gcd

def sol():
    n = int(input())
    a = [2] + list(map(int,input().split()))
    rl = []
    for i in range(1,n+1):
        if a[i] != a[i-1]:
            rl.append(1)
        else:
            rl[-1] += 1
    o = []
    for i in range(len(rl)):
        if i % 2 == 1:
            o.append(rl[i])
    if len(rl) % 2 == 0 or (len(rl) >= 3 and  max(o) >= 2):
        print('Yes')
    else:
        print('No')
        
    return 


T = int(input())
for i in range(T):
    sol()
0