結果
| 問題 |
No.1707 Simple Range Reverse Problem
|
| コンテスト | |
| ユーザー |
ntuda
|
| 提出日時 | 2022-03-10 12:12:04 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
AC
|
| 実行時間 | 47 ms / 2,000 ms |
| コード長 | 442 bytes |
| コンパイル時間 | 203 ms |
| コンパイル使用メモリ | 82,528 KB |
| 実行使用メモリ | 61,416 KB |
| 最終ジャッジ日時 | 2025-07-13 03:53:03 |
| 合計ジャッジ時間 | 1,727 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 1 |
| other | AC * 19 |
ソースコード
T = int(input())
for t in range(T):
N = int(input())
A = list(map(int, input().split()))
if sorted(A) != sorted(list(range(1,N+1)) * 2):
print("No")
continue
if A[0] != 1 or A[2 * N - 1] != N:
print("No")
continue
for i in range(1, 2 * N):
if not(abs(A[i] - A[i - 1]) == 1 or abs(A[i] - A[i - 1]) == N - 1):
print("No")
break
else:
print("Yes")
ntuda