結果
問題 |
No.2779 Don't make Pair
|
ユーザー |
|
提出日時 | 2024-06-07 23:15:34 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 344 bytes |
コンパイル時間 | 216 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 107,136 KB |
最終ジャッジ日時 | 2024-12-26 10:15:56 |
合計ジャッジ時間 | 4,814 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 4 WA * 1 |
other | AC * 21 WA * 3 |
ソースコード
n=int(input()) L=list(map(int,input().split())) SL,SR=set(),set() from collections import defaultdict dr=defaultdict(int) for e in L: dr[e]+=1 if 2<=dr[e]: SR.add(e) ans=[] for i in range(n): e=L[i] if e not in SL: SL.add(e) else: break dr[e]-=1 if dr[e]==1: SR-={e} if SR==set(): ans.append(i+1) print(len(ans)) print(*ans)