結果

問題 No.1707 Simple Range Reverse Problem
ユーザー lllllll88938494lllllll88938494
提出日時 2022-08-19 04:56:45
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 533 bytes
コンパイル時間 403 ms
コンパイル使用メモリ 82,548 KB
実行使用メモリ 72,860 KB
最終ジャッジ日時 2024-04-16 11:31:24
合計ジャッジ時間 1,954 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
54,144 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 AC 68 ms
72,860 KB
testcase_09 AC 47 ms
62,976 KB
testcase_10 AC 47 ms
63,104 KB
testcase_11 AC 47 ms
61,824 KB
testcase_12 AC 48 ms
63,232 KB
testcase_13 AC 50 ms
63,360 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import defaultdict
n=int(input())

for i in range(n):
    a=int(input())
    t=list(map(int,input().split()))
    dic = defaultdict(int)
    f=0
    ans=0
    for j in range(a*2):
        dic[t[j]] += 1
        if dic[t[j]] > 2:
            f=1
            break
        ind= j+1
        if ind > a:
            ind -= a
        tt=abs(t[j]-ind)

        ans=max(ans,tt)
        
    if ans > a-2:
        f = 1

    print('No' if f == 1 else 'Yes')
        

        
            
        
        
    

    
    
0