結果

問題 No.1707 Simple Range Reverse Problem
ユーザー O2MTO2MT
提出日時 2021-10-15 23:33:53
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 374 bytes
コンパイル時間 368 ms
コンパイル使用メモリ 81,848 KB
実行使用メモリ 62,016 KB
最終ジャッジ日時 2023-10-17 21:25:44
合計ジャッジ時間 2,170 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
53,456 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 46 ms
62,016 KB
testcase_05 AC 45 ms
59,968 KB
testcase_06 AC 44 ms
59,960 KB
testcase_07 AC 45 ms
59,960 KB
testcase_08 AC 46 ms
59,960 KB
testcase_09 AC 44 ms
59,960 KB
testcase_10 AC 44 ms
59,960 KB
testcase_11 AC 44 ms
59,952 KB
testcase_12 AC 44 ms
59,952 KB
testcase_13 AC 42 ms
59,952 KB
testcase_14 AC 44 ms
59,960 KB
testcase_15 AC 43 ms
59,960 KB
testcase_16 AC 44 ms
59,960 KB
testcase_17 AC 42 ms
59,952 KB
testcase_18 AC 44 ms
59,968 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

T = int(input())
for _ in range(T):
  N = int(input())
  A = list(map(int,input().split()))
  X = []

  for x in range(1,N+1):
    X.append(x)
    X.append(x)
  X.sort()
  AS = sorted(A)

  if X != AS:
    print('No')
    continue

  count = 0

  for i in range(1,2*N):
    if abs(A[i-1]-A[i]) > 1:
      count += 1

  if count == 1:
    print('Yes')
  else:
    print('No')
0