結果
| 問題 | No.1707 Simple Range Reverse Problem |
| コンテスト | |
| ユーザー |
hir355
|
| 提出日時 | 2021-10-15 21:33:20 |
| 言語 | PyPy3 (8.0.0 + ACL) |
| 結果 |
AC
不安定
|
| 実行時間 | 48 ms / 2,000 ms |
| + 54µs | |
| コード長 | 366 bytes |
| 記録 | |
| コンパイル時間 | 543 ms |
| コンパイル使用メモリ | 64,660 KB |
| 実行使用メモリ | 58,668 KB |
| 最終ジャッジ日時 | 2026-10-15 20:21:19 |
| 合計ジャッジ時間 | 2,791 ms |
|
ジャッジサーバーID (参考情報) |
judge2_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 20 |
ソースコード
t = int(input())
for _ in range(t):
n = int(input())
a = list(map(int, input().split()))
x = list(range(1, n + 1)) + list(range(1, n + 1))
for i in range(n):
if x[:i + 1] + x[i + 1:i+n][::-1] + x[i+n:] == a:
print('Yes')
break
else:
if x == a:
print('Yes')
else:
print('No')
hir355