Submission #3217368


Source Code Expand

N, K = map(int, input().split())
A = list(map(int, input().split()))

count_dict = {}
for i in range(len(A)):
	if A[i] in count_dict.keys():
		count_dict[A[i]] += 1
	else:
		count_dict[A[i]] = 1

if len(count_dict.keys()) <= K:
	print(0)
else:
	need = len(count_dict.keys()) - K
	temp = sorted(count_dict.values())
	res = 0
	for i in range(need):
		res += temp[i]
	print(res)

Submission Info

Submission Time
Task C - Not so Diverse
User iKureha
Language Python (3.4.3)
Score 300
Code Size 393 Byte
Status AC
Exec Time 168 ms
Memory 32184 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 300 / 300
Status
AC × 3
AC × 19
Set Name Test Cases
Sample sample1.txt, sample2.txt, sample3.txt
All sample1.txt, sample2.txt, sample3.txt, 1.txt, 10.txt, 11.txt, 12.txt, 13.txt, 2.txt, 3.txt, 4.txt, 5.txt, 6.txt, 7.txt, 8.txt, 9.txt, sample1.txt, sample2.txt, sample3.txt
Case Name Status Exec Time Memory
1.txt AC 17 ms 3064 KB
10.txt AC 135 ms 24716 KB
11.txt AC 136 ms 24708 KB
12.txt AC 168 ms 32184 KB
13.txt AC 130 ms 22460 KB
2.txt AC 17 ms 3064 KB
3.txt AC 137 ms 24740 KB
4.txt AC 139 ms 24852 KB
5.txt AC 133 ms 23632 KB
6.txt AC 128 ms 22604 KB
7.txt AC 122 ms 21504 KB
8.txt AC 137 ms 24748 KB
9.txt AC 144 ms 23376 KB
sample1.txt AC 17 ms 3064 KB
sample2.txt AC 16 ms 3060 KB
sample3.txt AC 16 ms 3064 KB