Submission #2229898
Source Code Expand
#include "bits/stdc++.h" using namespace std; #define FOR(i,a,b) for(int i =(a);i<(b);i++) #define REP(i,n) for(int i=0;i<(n);i++) #define REPm(i,n) for(int i=(n)-1;i>=0;i--) #define REP1(i,n) for(int i=1;i<=(n);i++) typedef long long ll; #define MAX_N 200000 vector<int> A(MAX_N,0); int main(){ int N,K,input,ans; cin >> N >> K; REP(i,N){ cin >> input; A[input-1]++; } sort(A.begin(),A.end(),greater<int>()); ans = N; REP(i,K) ans -= A[i]; cout << ans << endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Not so Diverse |
User | yankeiori |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 548 Byte |
Status | AC |
Exec Time | 80 ms |
Memory | 1024 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 | 4 ms | 1024 KB |
10.txt | AC | 78 ms | 1024 KB |
11.txt | AC | 80 ms | 1024 KB |
12.txt | AC | 78 ms | 1024 KB |
13.txt | AC | 73 ms | 1024 KB |
2.txt | AC | 4 ms | 1024 KB |
3.txt | AC | 78 ms | 1024 KB |
4.txt | AC | 80 ms | 1024 KB |
5.txt | AC | 76 ms | 1024 KB |
6.txt | AC | 71 ms | 1024 KB |
7.txt | AC | 75 ms | 1024 KB |
8.txt | AC | 75 ms | 1024 KB |
9.txt | AC | 79 ms | 1024 KB |
sample1.txt | AC | 4 ms | 1024 KB |
sample2.txt | AC | 4 ms | 1024 KB |
sample3.txt | AC | 4 ms | 1024 KB |