63192023-11-15 16:59:25almaaaFormula-1cpp17Accepted 100/1003ms4660 KiB
#include <iostream>
#include <vector>
#include <climits>

using namespace std;

int sum(vector <int> v, int n){
    int s = 0;
    for(int i=0;i<n;i++){
        s = s+v[i];
    }
    return s;
}

int minn(vector <int> v, int n){
    int m = INT_MAX;
    for(int i=0;i<n;i++){
        if(v[i]<m) m=v[i];
    }
    return m;
}

int main(){
    int n,h,v;
    vector <int> hh,vv;
    cin>>n;

    for(int i=0;i<n;i++){
        cin>>h;
        hh.push_back(h);
    }

    for(int i=0;i<n;i++){
        cin>>v;
        vv.push_back(v);
    }

    if(sum(hh,n)<sum(vv,n)) cout<<"Hamilton\n";
    else cout<<"Verstappen\n";

    if(minn(hh,n)<minn(vv,n)) cout<<"Hamilton\n";
    else cout<<"Verstappen\n";


}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1808 KiB
2Accepted3ms2004 KiB
subtask210/10
3Accepted2ms2088 KiB
4Accepted3ms2216 KiB
5Accepted3ms2456 KiB
6Accepted3ms2692 KiB
subtask315/15
7Accepted2ms2728 KiB
8Accepted3ms2968 KiB
9Accepted3ms3068 KiB
10Accepted3ms3148 KiB
11Accepted2ms3144 KiB
subtask420/20
12Accepted3ms3400 KiB
13Accepted3ms3472 KiB
14Accepted3ms3468 KiB
15Accepted3ms3600 KiB
16Accepted3ms3676 KiB
17Accepted3ms3684 KiB
18Accepted3ms3824 KiB
19Accepted2ms3900 KiB
subtask555/55
20Accepted2ms4016 KiB
21Accepted3ms4012 KiB
22Accepted3ms3896 KiB
23Accepted3ms4164 KiB
24Accepted2ms3916 KiB
25Accepted3ms4112 KiB
26Accepted3ms4356 KiB
27Accepted3ms4632 KiB
28Accepted3ms4660 KiB