結果
| 問題 | No.1707 Simple Range Reverse Problem |
| コンテスト | |
| ユーザー |
wolgnik
|
| 提出日時 | 2021-10-15 21:50:40 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 40 ms / 2,000 ms |
| + 222µs | |
| コード長 | 342 bytes |
| 記録 | |
| コンパイル時間 | 79 ms |
| コンパイル使用メモリ | 64,684 KB |
| 実行使用メモリ | 58,584 KB |
| 最終ジャッジ日時 | 2026-10-15 20:22:32 |
| 合計ジャッジ時間 | 2,574 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge5_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
import sys
input = sys.stdin.readline
for _ in range(int(input())):
N = int(input())
a = list(map(int, input().split()))
p = list(range(1, N + 1)) * 2
if a == p:
print("Yes")
continue
for i in range(N):
if a == p[: i + 1] + p[i + 1: i + N][: : -1] + p[i + N: ]: break
else:
print("No")
continue
print("Yes")
wolgnik