結果

問題 No.1707 Simple Range Reverse Problem
ユーザー hirayuu_yc
提出日時 2025-01-11 09:27:19
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 69 ms / 2,000 ms
コード長 268 bytes
コンパイル時間 228 ms
コンパイル使用メモリ 82,456 KB
実行使用メモリ 75,436 KB
最終ジャッジ日時 2025-07-13 03:54:36
合計ジャッジ時間 2,102 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 1
other AC * 19
権限があれば一括ダウンロードができます

ソースコード

diff #

T=int(input())
for _ in range(T):
    N=int(input())
    A=list(map(int,input().split()))
    X=list(range(1,N+1))*2
    ans="No"
    for i in range(N):
        if A==X[:i+1]+X[i+1:i+N][::-1]+X[i+N:]:
            ans="Yes"
    if A==X:
        ans="Yes"
    print(ans)
0