結果
問題 |
No.1707 Simple Range Reverse Problem
|
ユーザー |
![]() |
提出日時 | 2022-08-19 04:56:45 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 533 bytes |
コンパイル時間 | 377 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 72,960 KB |
最終ジャッジ日時 | 2024-10-07 05:19:59 |
合計ジャッジ時間 | 2,217 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | AC * 6 WA * 12 |
ソースコード
from collections import defaultdict n=int(input()) for i in range(n): a=int(input()) t=list(map(int,input().split())) dic = defaultdict(int) f=0 ans=0 for j in range(a*2): dic[t[j]] += 1 if dic[t[j]] > 2: f=1 break ind= j+1 if ind > a: ind -= a tt=abs(t[j]-ind) ans=max(ans,tt) if ans > a-2: f = 1 print('No' if f == 1 else 'Yes')