結果
問題 | No.2779 Don't make Pair |
ユーザー |
|
提出日時 | 2025-02-19 11:37:17 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 383 bytes |
コンパイル時間 | 913 ms |
コンパイル使用メモリ | 81,792 KB |
実行使用メモリ | 102,172 KB |
最終ジャッジ日時 | 2025-02-19 11:37:23 |
合計ジャッジ時間 | 5,308 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 WA * 2 |
other | AC * 14 WA * 10 |
ソースコード
from collections import defaultdictn=int(input())A=list(map(int,input().split()))D=defaultdict(list)for i,j in enumerate(A):D[j].append(i+1)l,r=1,n-1for I in D.values():if len(I)>2:print(0)exit()elif len(I)==2:l=max(l,min(I))r=min(r,max(I)-1)if r-l+1<=0:print(0)exit()print(r-l+1)print(*[i for i in range(l,r+1)])