-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathA.cpp
More file actions
39 lines (31 loc) · 683 Bytes
/
A.cpp
File metadata and controls
39 lines (31 loc) · 683 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
#include <vector>
#include <iostream>
#include <algorithm>
using namespace std;
void solve(vector<int> orbis, int c)
{
int mn = 0;
for (int i=0; i<101; i++) mn += min(orbis[i], c);
cout << mn << endl;
}
void parse()
{
vector<int> orbis(101);
int s, c;
cin >> s >> c;
for (int i=0; i<s; i++)
{
int o;
cin >> o;
orbis[o]++;
}
solve(orbis, c);
}
int main()
{
int cases = 1;
cin >> cases;
while (cases--)
parse();
return (0);
}