Submission #1858429
Source Code Expand
#include <bits/stdc++.h> #define REP(i,n) for(int i=0; i<(int)(n); ++i) #define FOR(i,k,n) for(int i=(k);i<(int)(n);++i) typedef long long int ll; using namespace std; int main(void) { int N, K; cin >> N >> K; map<int, int> A; REP(i, N) { int t; cin >> t; A[t]++; } vector<int> v; for(auto x : A) { v.push_back(x.second); } sort(v.rbegin(), v.rend()); int ans = 0; for(int i=K; i<=v.size(); ++i) { ans += v[i]; } cout << ans << endl; }
Submission Info
Submission Time | |
---|---|
Task | C - Not so Diverse |
User | kivantium |
Language | C++14 (GCC 5.4.1) |
Score | 300 |
Code Size | 556 Byte |
Status | AC |
Exec Time | 146 ms |
Memory | 10748 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 | 256 KB |
10.txt | AC | 64 ms | 256 KB |
11.txt | AC | 68 ms | 256 KB |
12.txt | AC | 146 ms | 10748 KB |
13.txt | AC | 71 ms | 512 KB |
2.txt | AC | 1 ms | 256 KB |
3.txt | AC | 67 ms | 256 KB |
4.txt | AC | 74 ms | 384 KB |
5.txt | AC | 73 ms | 384 KB |
6.txt | AC | 69 ms | 384 KB |
7.txt | AC | 56 ms | 384 KB |
8.txt | AC | 57 ms | 256 KB |
9.txt | AC | 89 ms | 1152 KB |
sample1.txt | AC | 1 ms | 256 KB |
sample2.txt | AC | 1 ms | 256 KB |
sample3.txt | AC | 1 ms | 256 KB |