結果

問題 No.1707 Simple Range Reverse Problem
ユーザー kohei2019kohei2019
提出日時 2023-06-09 15:42:30
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 97 ms / 2,000 ms
コード長 390 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 87,272 KB
実行使用メモリ 76,604 KB
最終ジャッジ日時 2023-08-30 09:20:28
合計ジャッジ時間 3,657 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 76 ms
71,356 KB
testcase_01 AC 80 ms
75,820 KB
testcase_02 AC 82 ms
75,840 KB
testcase_03 AC 80 ms
75,800 KB
testcase_04 AC 78 ms
75,916 KB
testcase_05 AC 78 ms
75,952 KB
testcase_06 AC 78 ms
75,820 KB
testcase_07 AC 80 ms
75,768 KB
testcase_08 AC 79 ms
76,116 KB
testcase_09 AC 84 ms
76,460 KB
testcase_10 AC 84 ms
76,344 KB
testcase_11 AC 76 ms
75,964 KB
testcase_12 AC 87 ms
76,480 KB
testcase_13 AC 92 ms
76,604 KB
testcase_14 AC 93 ms
76,364 KB
testcase_15 AC 97 ms
76,464 KB
testcase_16 AC 95 ms
76,452 KB
testcase_17 AC 90 ms
76,364 KB
testcase_18 AC 96 ms
76,448 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for i in range(T):
    N = int(input())
    ls = list(map(int,input().split()))
    stls = [i for i in range(1,N+1)]+[i for i in range(1,N+1)]
    if ls == stls:
        print('Yes')
        continue
    for j in range(N):
        vls = stls[:j+1]+stls[j+1:j+N][::-1]+stls[j+N:]
        if ls == vls:
            print('Yes')
            break
    else:
        print('No')
0