40912023-03-13 18:15:19horvathabelBejgli (80 pont)cpp17Accepted 80/8032ms4644 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin>>n;
	map<int, int> m;
	for (int i=0; i<n;i++){
		int x; 
		cin>>x;
		m[x]++; 
	}
	pair<int,int> ans={0,0};
	int cnt=0;
	for (auto x:m){
		cnt+=x.second/x.first;
		if (x.second/x.first>ans.first){
			ans.first=x.second/x.first;
			ans.second=x.first;
		}
	}
	cout<<cnt<<endl<<ans.second; 
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1808 KiB
2Accepted0/02ms2004 KiB
3Accepted4/42ms2092 KiB
4Accepted4/43ms2368 KiB
5Accepted4/43ms2528 KiB
6Accepted4/43ms2680 KiB
7Accepted4/43ms3200 KiB
8Accepted4/43ms3176 KiB
9Accepted4/43ms3320 KiB
10Accepted4/43ms3316 KiB
11Accepted4/43ms3380 KiB
12Accepted4/44ms3508 KiB
13Accepted4/44ms3720 KiB
14Accepted4/44ms3932 KiB
15Accepted4/46ms4192 KiB
16Accepted4/46ms4192 KiB
17Accepted4/413ms4472 KiB
18Accepted4/419ms4468 KiB
19Accepted4/427ms4544 KiB
20Accepted4/427ms4560 KiB
21Accepted4/432ms4644 KiB
22Accepted4/423ms4548 KiB