結果
| 問題 | 
                            No.1707 Simple Range Reverse Problem
                             | 
                    
| コンテスト | |
| ユーザー | 
                             | 
                    
| 提出日時 | 2021-10-15 23:29:03 | 
| 言語 | PyPy3  (7.3.15)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 232 bytes | 
| コンパイル時間 | 255 ms | 
| コンパイル使用メモリ | 81,888 KB | 
| 実行使用メモリ | 61,372 KB | 
| 最終ジャッジ日時 | 2024-09-17 18:31:32 | 
| 合計ジャッジ時間 | 1,689 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge5 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 1 | 
| other | AC * 15 WA * 3 | 
ソースコード
T = int(input())
for _ in range(T):
  N = int(input())
  A = list(map(int,input().split()))
  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')