結果
問題 | No.1707 Simple Range Reverse Problem |
ユーザー |
![]() |
提出日時 | 2021-10-15 21:50:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 61 ms / 2,000 ms |
コード長 | 342 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 82,316 KB |
実行使用メモリ | 75,320 KB |
最終ジャッジ日時 | 2024-09-17 17:25:48 |
合計ジャッジ時間 | 1,756 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 |
ソースコード
import sysinput = sys.stdin.readlinefor _ in range(int(input())):N = int(input())a = list(map(int, input().split()))p = list(range(1, N + 1)) * 2if a == p:print("Yes")continuefor i in range(N):if a == p[: i + 1] + p[i + 1: i + N][: : -1] + p[i + N: ]: breakelse:print("No")continueprint("Yes")