結果

問題 No.2518 Adjacent Larger
ユーザー akebono03
提出日時 2023-10-27 22:35:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 479 bytes
コンパイル時間 320 ms
コンパイル使用メモリ 82,708 KB
実行使用メモリ 102,328 KB
最終ジャッジ日時 2024-09-25 14:37:45
合計ジャッジ時間 4,372 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 13 WA * 15
権限があれば一括ダウンロードができます

ソースコード

diff #

def ip():return int(input())
def mp():return map(int, input().split())
def lmp():return list(map(int, input().split()))
T = ip()
from collections import defaultdict
def solve():
    N = ip()
    A = lmp()
    cnt = defaultdict(int)
    for i in range(N):
        cnt[A[i]] += 1
        if A[i] != 1 and A[i] == A[i-1]:
            print('No')
            return
    if cnt[0] == 0 or cnt[2] == 0:
        print('No')
    else:
        print('Yes')
for _ in range(T):
    solve()
0