Submission #2204519
Source Code Expand
#include<bits/stdc++.h> using namespace std; map<int,int> data; pair<int,int> meh[2000005]; bool cmp(pair<int,int> a,pair<int,int> b){ return a.second<b.second; } int main(){ int n,k; scanf("%d %d",&n,&k); for(int i=0;i<n;i++){ int u; scanf("%d",&u); data[u]++; } int hit=0; for(map<int,int>::iterator it=data.begin();it!=data.end();it++){ meh[hit]= make_pair(it->first,it->second); hit++; } sort(meh,meh+hit,cmp); for(int i=hit-1;i>=0;i--){ if(k==0)break; n-=meh[i].second; k--; } cout<<n<<endl; return 0; }
Submission Info
Submission Time | |
---|---|
Task | C - Not so Diverse |
User | vjudge1 |
Language | Bash (GNU bash v4.3.11) |
Score | 0 |
Code Size | 537 Byte |
Status | RE |
Exec Time | 3 ms |
Memory | 584 KB |
Judge Result
Set Name | Sample | All | ||||
---|---|---|---|---|---|---|
Score / Max Score | 0 / 0 | 0 / 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 | RE | 3 ms | 576 KB |
10.txt | RE | 3 ms | 580 KB |
11.txt | RE | 3 ms | 580 KB |
12.txt | RE | 3 ms | 580 KB |
13.txt | RE | 3 ms | 572 KB |
2.txt | RE | 3 ms | 580 KB |
3.txt | RE | 3 ms | 580 KB |
4.txt | RE | 3 ms | 584 KB |
5.txt | RE | 3 ms | 576 KB |
6.txt | RE | 3 ms | 576 KB |
7.txt | RE | 3 ms | 572 KB |
8.txt | RE | 3 ms | 580 KB |
9.txt | RE | 3 ms | 572 KB |
sample1.txt | RE | 3 ms | 572 KB |
sample2.txt | RE | 3 ms | 576 KB |
sample3.txt | RE | 3 ms | 576 KB |