98332024-03-10 11:20:25zhuyiFormula-1cpp17Accepted 100/1003ms5036 KiB
#include<iostream>
#include<vector>
#include<string>
using namespace std;

int main()
{
    int n;
    cin>>n;
    int h_ossz =0;
    int v_ossz =0;
    vector<int> hamilton = {};
    vector<int> verstappen ={};
    for(int i = 1;i<=n;i++){
        int h_kor=0;
        cin>>h_kor;
        hamilton.push_back(h_kor);
        h_ossz += h_kor;
    }
    for(int i = 1;i<=n;i++){
        int v_kor=0;
        cin>>v_kor;
        verstappen.push_back(v_kor);
        v_ossz += v_kor;
    }
    int legk = hamilton[0];
    string name = "Hamilton";
    for(int i= 0;i<n;i++){
        if(hamilton[i]<legk){
            legk = hamilton[i];
            name = "Hamilton";
        }
        if(verstappen[i]<legk){
            legk = verstappen[i];
            name = "Verstappen";
        }
    }
    if(h_ossz < v_ossz) cout<<"Hamilton"<<endl;
    else cout<<"Verstappen"<<endl;
    cout<<name<<endl;



}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1868 KiB
2Accepted3ms2004 KiB
subtask210/10
3Accepted2ms2000 KiB
4Accepted2ms2004 KiB
5Accepted2ms2012 KiB
6Accepted2ms2016 KiB
subtask315/15
7Accepted3ms2148 KiB
8Accepted3ms2400 KiB
9Accepted3ms2704 KiB
10Accepted3ms2716 KiB
11Accepted3ms2852 KiB
subtask420/20
12Accepted3ms3068 KiB
13Accepted3ms3312 KiB
14Accepted3ms3400 KiB
15Accepted3ms3580 KiB
16Accepted3ms3796 KiB
17Accepted3ms3928 KiB
18Accepted3ms4044 KiB
19Accepted3ms4160 KiB
subtask555/55
20Accepted3ms4300 KiB
21Accepted3ms4380 KiB
22Accepted3ms4468 KiB
23Accepted3ms4468 KiB
24Accepted3ms4724 KiB
25Accepted3ms4808 KiB
26Accepted3ms4892 KiB
27Accepted3ms4912 KiB
28Accepted3ms5036 KiB