結果

問題 No.2779 Don't make Pair
ユーザー moon17moon17
提出日時 2024-06-07 23:12:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 166 ms / 2,000 ms
コード長 289 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 82,036 KB
実行使用メモリ 112,000 KB
最終ジャッジ日時 2024-06-07 23:12:29
合計ジャッジ時間 4,215 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 39 ms
53,632 KB
testcase_01 AC 38 ms
54,016 KB
testcase_02 AC 38 ms
53,376 KB
testcase_03 AC 37 ms
53,888 KB
testcase_04 AC 39 ms
53,888 KB
testcase_05 AC 38 ms
53,632 KB
testcase_06 AC 39 ms
53,376 KB
testcase_07 AC 40 ms
53,504 KB
testcase_08 AC 41 ms
53,880 KB
testcase_09 AC 57 ms
65,280 KB
testcase_10 AC 79 ms
86,016 KB
testcase_11 AC 62 ms
68,608 KB
testcase_12 AC 117 ms
99,456 KB
testcase_13 AC 106 ms
92,416 KB
testcase_14 AC 95 ms
90,880 KB
testcase_15 AC 130 ms
107,264 KB
testcase_16 AC 131 ms
104,960 KB
testcase_17 AC 124 ms
97,152 KB
testcase_18 AC 106 ms
98,560 KB
testcase_19 AC 122 ms
103,040 KB
testcase_20 AC 98 ms
88,436 KB
testcase_21 AC 166 ms
110,592 KB
testcase_22 AC 139 ms
111,872 KB
testcase_23 AC 162 ms
111,488 KB
testcase_24 AC 144 ms
111,872 KB
testcase_25 AC 140 ms
111,872 KB
testcase_26 AC 140 ms
110,592 KB
testcase_27 AC 143 ms
112,000 KB
testcase_28 AC 136 ms
111,872 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import*
n,*a=map(int,open(0).read().split())
r=Counter(a)
l=Counter()
sr=sum(v>1 for v in r.values())
sl=0
ans=[]
for i in range(n-1):
  l[a[i]]+=1
  if l[a[i]]==2:
    sl+=1
  r[a[i]]-=1
  if r[a[i]]==1:
    sr-=1
  if sl==sr==0:
    ans+=i+1,
print(len(ans))
print(*ans)
0