結果
| 問題 | No.1707 Simple Range Reverse Problem |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2025-04-10 11:37:49 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
AC
|
| 実行時間 | 111 ms / 2,000 ms |
| + 177µs | |
| コード長 | 436 bytes |
| 記録 | |
| コンパイル時間 | 1,052 ms |
| コンパイル使用メモリ | 21,412 KB |
| 実行使用メモリ | 15,868 KB |
| 最終ジャッジ日時 | 2026-07-13 05:32:49 |
| 合計ジャッジ時間 | 4,061 ms |
|
ジャッジサーバーID (参考情報) |
judge1_0 / judge3_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 19 |
ソースコード
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
b = [x for x in range(1, n+1)]
c = [x for x in range(1, n+1)]
bc = b + c
flag = False
if bc == a:
flag = True
else:
for i in range(n):
j = i + n
tmp = bc[:i] + bc[i:j+1][::-1] + bc[j+1:]
if tmp == a:
flag = True
print("Yes" if flag else "No")