Submission #2215996
Source Code Expand
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
#define FOR(i, a, b) for(i = a; i < b; ++i)
#define REP(i, n) FOR(i, 0, n)
#define comp(a, b) int comp(const void *a, const void *b)
#define MOD 1000000007
typedef unsigned int uint;
typedef unsigned long ul;
typedef long long ll;
typedef unsigned long long ull;
void TF_print(char boolean, char T[], char F[]){
if(boolean){
printf("%s\n", T);
}else{
printf("%s\n", F);
}
}
comp(a, b){
return *(uint*)b - *(uint*)a;
}
int main(){
uint i, N, K;
uint ANS = 0;
scanf("%u %u", &N, &K);
int num[N], temp;
REP(i, N){
num[i] = 0;
}
REP(i, N){
scanf("%u", &temp);
num[temp - 1]++;
}
qsort(num, N, sizeof(uint), comp);
i = K;
while(num[i] > 0 && i < N){
ANS += num[i];
i++;
}
printf("%u\n", ANS);
return 0;
}
Submission Info
Submission Time |
|
Task |
C - Not so Diverse |
User |
kumachan_atcoder |
Language |
C (Clang 3.8.0) |
Score |
300 |
Code Size |
942 Byte |
Status |
AC |
Exec Time |
31 ms |
Memory |
1404 KB |
Judge Result
Set Name |
Sample |
All |
Score / Max Score |
0 / 0 |
300 / 300 |
Status |
|
|
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 |
1 ms |
128 KB |
10.txt |
AC |
30 ms |
1404 KB |
11.txt |
AC |
29 ms |
1404 KB |
12.txt |
AC |
31 ms |
1276 KB |
13.txt |
AC |
28 ms |
1276 KB |
2.txt |
AC |
1 ms |
128 KB |
3.txt |
AC |
30 ms |
1404 KB |
4.txt |
AC |
30 ms |
1404 KB |
5.txt |
AC |
29 ms |
1276 KB |
6.txt |
AC |
27 ms |
1276 KB |
7.txt |
AC |
26 ms |
1276 KB |
8.txt |
AC |
28 ms |
1404 KB |
9.txt |
AC |
31 ms |
1404 KB |
sample1.txt |
AC |
1 ms |
128 KB |
sample2.txt |
AC |
1 ms |
128 KB |
sample3.txt |
AC |
1 ms |
128 KB |