結果

問題 No.1707 Simple Range Reverse Problem
ユーザー irumo8202irumo8202
提出日時 2022-01-29 15:31:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 100 ms / 2,000 ms
コード長 330 bytes
コンパイル時間 871 ms
コンパイル使用メモリ 87,120 KB
実行使用メモリ 76,968 KB
最終ジャッジ日時 2023-08-30 14:39:21
合計ジャッジ時間 3,737 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,544 KB
testcase_01 AC 79 ms
76,052 KB
testcase_02 AC 80 ms
76,232 KB
testcase_03 AC 79 ms
76,232 KB
testcase_04 AC 76 ms
76,324 KB
testcase_05 AC 78 ms
76,148 KB
testcase_06 AC 77 ms
75,884 KB
testcase_07 AC 77 ms
76,024 KB
testcase_08 AC 79 ms
76,248 KB
testcase_09 AC 92 ms
76,580 KB
testcase_10 AC 92 ms
76,784 KB
testcase_11 AC 86 ms
76,644 KB
testcase_12 AC 96 ms
76,912 KB
testcase_13 AC 100 ms
76,912 KB
testcase_14 AC 88 ms
76,492 KB
testcase_15 AC 95 ms
76,968 KB
testcase_16 AC 92 ms
76,888 KB
testcase_17 AC 88 ms
76,772 KB
testcase_18 AC 91 ms
76,940 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())

for _ in range(T):
    N = int(input())
    A = list(map(int, input().split()))

    X = list(map(lambda x: (x % N) + 1, range(2 * N)))

    flg = A == X
    for i in range(N):
        B = A[:i] + A[i : i + N + 1][::-1] + A[i + N + 1 :]
        if X == B:
            flg = True
    print("Yes" if flg else "No")
0