70962023-12-30 11:40:14IgnácBejgli (80 pont)cpp17Accepted 80/8035ms3268 KiB
#include <bits/stdc++.h>
using namespace std;

int main() {
	int n;
	cin >> n;
	map<int, int> db;
	int ossz = 0, i = 0;
	while (i < n) {
		int a;
		cin >> a;
		db[a]++;
		ossz++;
		i += a;
		for (int j = 0; j < a - 1; j++) {
			cin >> a;
		}
	}

	cout << ossz << '\n';
	int maxhossz = 0;
	for (pair<int, int> szelet : db) {
		if (szelet.second > db[maxhossz]) maxhossz = szelet.first;
	}
	
	cout << maxhossz;
}
SubtaskSumTestVerdictTimeMemory
base80/80
1Accepted0/03ms1816 KiB
2Accepted0/03ms2000 KiB
3Accepted4/43ms2220 KiB
4Accepted4/43ms2452 KiB
5Accepted4/43ms2588 KiB
6Accepted4/43ms2660 KiB
7Accepted4/43ms2684 KiB
8Accepted4/43ms2756 KiB
9Accepted4/43ms2888 KiB
10Accepted4/43ms3028 KiB
11Accepted4/43ms2984 KiB
12Accepted4/43ms2972 KiB
13Accepted4/44ms3092 KiB
14Accepted4/44ms3036 KiB
15Accepted4/46ms3048 KiB
16Accepted4/46ms3200 KiB
17Accepted4/413ms3188 KiB
18Accepted4/419ms3260 KiB
19Accepted4/428ms3264 KiB
20Accepted4/428ms3268 KiB
21Accepted4/435ms3260 KiB
22Accepted4/423ms3264 KiB