結果
問題 | No.2779 Don't make Pair |
ユーザー |
|
提出日時 | 2024-06-07 23:13:18 |
言語 | PyPy3 (7.3.15) |
結果 |
WA
|
実行時間 | - |
コード長 | 364 bytes |
コンパイル時間 | 154 ms |
コンパイル使用メモリ | 82,304 KB |
実行使用メモリ | 107,392 KB |
最終ジャッジ日時 | 2024-06-07 23:13:24 |
合計ジャッジ時間 | 3,740 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge2 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | WA | - |
testcase_01 | AC | 45 ms
53,120 KB |
testcase_02 | WA | - |
testcase_03 | AC | 41 ms
53,120 KB |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | WA | - |
testcase_07 | WA | - |
testcase_08 | AC | 39 ms
53,248 KB |
testcase_09 | AC | 51 ms
63,744 KB |
testcase_10 | AC | 75 ms
80,768 KB |
testcase_11 | AC | 57 ms
66,432 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | WA | - |
testcase_15 | WA | - |
testcase_16 | AC | 109 ms
101,632 KB |
testcase_17 | WA | - |
testcase_18 | WA | - |
testcase_19 | WA | - |
testcase_20 | WA | - |
testcase_21 | AC | 125 ms
107,136 KB |
testcase_22 | AC | 121 ms
107,136 KB |
testcase_23 | WA | - |
testcase_24 | AC | 114 ms
107,392 KB |
testcase_25 | AC | 119 ms
107,136 KB |
testcase_26 | WA | - |
testcase_27 | WA | - |
testcase_28 | AC | 135 ms
106,752 KB |
ソースコード
n=int(input()) L=list(map(int,input().split())) SL,SR=set(),set() from collections import defaultdict dl=defaultdict(int) 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]==0: SR-={e} if SR==set(): ans.append(i+1) print(len(ans)) print(*ans)