243482026-02-09 18:32:41BoldizsárBejgli (80 pont)cpp17Accepted 80/8032ms1076 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;cin >> n;
    vector<int>bejgli(n+1);
    int cnt=0,most=1;
    for(int i = 1;i <= n;i++){
        int temp;cin >> temp;
        bejgli[temp]++;

    }
    for(int i = 1;i <=n;i++) {bejgli[i] = bejgli[i]/i;}
    for(int i = 1;i <=n;i++) {
        cnt += bejgli[i];
        if(bejgli[i]>bejgli[most]){
            most = i;
        }
    }
    cout << cnt << "\n" << most;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/01ms316 KiB
2Accepted0/01ms316 KiB
3Accepted4/41ms316 KiB
4Accepted4/41ms316 KiB
5Accepted4/41ms316 KiB
6Accepted4/41ms316 KiB
7Accepted4/41ms316 KiB
8Accepted4/41ms316 KiB
9Accepted4/41ms316 KiB
10Accepted4/41ms316 KiB
11Accepted4/42ms316 KiB
12Accepted4/42ms316 KiB
13Accepted4/43ms316 KiB
14Accepted4/43ms400 KiB
15Accepted4/44ms512 KiB
16Accepted4/44ms316 KiB
17Accepted4/410ms564 KiB
18Accepted4/419ms608 KiB
19Accepted4/426ms564 KiB
20Accepted4/427ms820 KiB
21Accepted4/432ms1076 KiB
22Accepted4/421ms564 KiB