62012023-11-07 19:04:18GhostFormula-1cpp17Accepted 100/1003ms4348 KiB
#include <iostream>
#include <vector>
#include <algorithm>

using namespace std;

int main()
{
    int n, i;
    cin >> n;

    vector<int> hamilton(n);
    vector<int> verstappen(n);
    for (i = 0; i < n; i++) {
        cin >> hamilton[i];
    }
    for (i = 0; i < n; i++) {
        cin >> verstappen[i];
    }

    int ham = 0, ver = 0;
    for (i = 0; i < n; i++) {
        ham += hamilton[i];
        ver += verstappen[i];
    }
    sort(hamilton.begin(), hamilton.end());
    sort(verstappen.begin(), verstappen.end());

    if (ham < ver) {
        cout << "Hamilton" << endl;
    }
    else {
        cout << "Verstappen" << endl;
    }
    if (hamilton[0] < verstappen[0]) {
        cout << "Hamilton";
    }
    else {
        cout << "Verstappen";
    }
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1812 KiB
2Accepted3ms2004 KiB
subtask210/10
3Accepted2ms2244 KiB
4Accepted2ms2300 KiB
5Accepted3ms2544 KiB
6Accepted2ms2656 KiB
subtask315/15
7Accepted3ms2884 KiB
8Accepted3ms3096 KiB
9Accepted3ms3304 KiB
10Accepted3ms3416 KiB
11Accepted3ms3628 KiB
subtask420/20
12Accepted2ms3604 KiB
13Accepted3ms3836 KiB
14Accepted2ms3808 KiB
15Accepted2ms3816 KiB
16Accepted2ms3808 KiB
17Accepted2ms3936 KiB
18Accepted3ms4052 KiB
19Accepted2ms4140 KiB
subtask555/55
20Accepted2ms4148 KiB
21Accepted3ms3992 KiB
22Accepted3ms3996 KiB
23Accepted3ms4024 KiB
24Accepted2ms4100 KiB
25Accepted2ms4220 KiB
26Accepted3ms4240 KiB
27Accepted3ms4228 KiB
28Accepted3ms4348 KiB