結果
問題 | No.1707 Simple Range Reverse Problem |
ユーザー |
![]() |
提出日時 | 2022-03-10 12:12:04 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 50 ms / 2,000 ms |
コード長 | 442 bytes |
コンパイル時間 | 389 ms |
コンパイル使用メモリ | 82,432 KB |
実行使用メモリ | 60,160 KB |
最終ジャッジ日時 | 2024-09-14 13:23:45 |
合計ジャッジ時間 | 2,088 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 18 |
ソースコード
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")