結果
問題 | No.1707 Simple Range Reverse Problem |
ユーザー |
![]() |
提出日時 | 2021-10-15 21:34:08 |
言語 | PyPy3 (7.3.15) |
結果 |
RE
|
実行時間 | - |
コード長 | 658 bytes |
コンパイル時間 | 154 ms |
コンパイル使用メモリ | 82,300 KB |
実行使用メモリ | 66,964 KB |
最終ジャッジ日時 | 2024-09-17 17:16:37 |
合計ジャッジ時間 | 1,494 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge6 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 5 WA * 6 RE * 7 |
ソースコード
import sys sys.setrecursionlimit(10 ** 6) def input(): return sys.stdin.readline().rstrip() def main(): # 1回調べれば良い t = int(input()) for _ in range(t): n = int(input()) a = list(map(int, input().split())) for i in range(1, n + 1): if a[i - 1] != i: for j in range(n): a[i + j], a[i + n - j] = a[i + n - j], a[i + j] if a == list(range(1, n + 1)): print("Yes") else: print("No") break else: print("Yes") if __name__ == '__main__': main()