117782024-11-10 16:12:50MittomenFormula-1cpp17Accepted 100/1002ms560 KiB
#include <iostream>
#include <climits>

using namespace std;

#define MIN(a, b) a < b ? a : b

int main() {
	short unsigned int n;
	unsigned int min_time = UINT_MAX;
	bool fastest = false; // false: Hamilton, true: Verstappen
	unsigned int hamilton = 0, verstappen = 0;

	cin >> n;
	 
	int round;
	for (short int i = 0; i < n; i++) {
		cin >> round;

		hamilton += round;

		min_time = MIN(min_time, round);
	}

	for (short int i = 0; i < n; i++) {
		cin >> round;

		verstappen += round;

		if (round < min_time) fastest = true;
	}

	cout << (verstappen < hamilton ? "Verstappen" : "Hamilton") << endl;
	cout << (fastest ? "Verstappen" : "Hamilton");

	return 0;
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted1ms320 KiB
2Accepted1ms320 KiB
subtask210/10
3Accepted1ms320 KiB
4Accepted1ms320 KiB
5Accepted1ms320 KiB
6Accepted1ms328 KiB
subtask315/15
7Accepted1ms560 KiB
8Accepted1ms332 KiB
9Accepted1ms320 KiB
10Accepted1ms320 KiB
11Accepted1ms320 KiB
subtask420/20
12Accepted1ms508 KiB
13Accepted1ms320 KiB
14Accepted1ms320 KiB
15Accepted1ms320 KiB
16Accepted1ms500 KiB
17Accepted1ms320 KiB
18Accepted2ms320 KiB
19Accepted2ms320 KiB
subtask555/55
20Accepted1ms320 KiB
21Accepted1ms320 KiB
22Accepted1ms320 KiB
23Accepted1ms388 KiB
24Accepted1ms320 KiB
25Accepted1ms320 KiB
26Accepted1ms320 KiB
27Accepted1ms320 KiB
28Accepted1ms320 KiB