117762024-11-10 16:11:59MittomenFormula-1cpp17Forditási hiba
#include <iostream>

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;
}
Forditási hiba
open /var/local/lib/isolate/412/box/a.out: no such file or directory
main.cpp: In function 'int main()':
main.cpp:9:33: error: 'UINT_MAX' was not declared in this scope
    9 |         unsigned int min_time = UINT_MAX;
      |                                 ^~~~~~~~
main.cpp:2:1: note: 'UINT_MAX' is defined in header '<climits>'; did you forget to '#include <climits>'?
    1 | #include <iostream>
  +++ |+#include <climits>
    2 |