結果

問題 No.1707 Simple Range Reverse Problem
ユーザー syunsukesyunsuke
提出日時 2021-11-22 17:42:15
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 395 bytes
コンパイル時間 539 ms
コンパイル使用メモリ 82,668 KB
実行使用メモリ 69,152 KB
最終ジャッジ日時 2024-06-24 05:34:32
合計ジャッジ時間 2,505 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 6 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

for _ in range(T):
    N = int(input())
    l = list(map(int,input().split()))
    F = 1
    if l[0] != 1 or l[-1] != N:
        F = 0
    L = [0 for i in range(N+1)]
    L[0] = 2
    for i in range(2*N):
        if l[i] > N:
            F = 0
        else:
            L[l[i]] += 1
    if min(L) != 2:
        F = 0
    if F:
        print("Yes")
    else:
        print("No")
0