63172023-11-15 16:56:48Pbg4444Formula-1cpp17Wrong answer 0/1003ms4740 KiB
#include <iostream>
#include <string>

int main(){
    int n;
    std::cin>>n;
    int v[n], h[n];
    int vv=0;
    int hh;
    int nn;
    bool ham;
    for (int i = 0; i < n; i++)
    {
        std::cin>>h[i];
    }
    for (int i = 0; i < n; i++)
    {
        std::cin>>v[i];
    }
    if (v[0] < h[0]){
        nn = v[0];
        ham = false;
    } 
    else {
        nn = h[0];
        ham = true;
    }
    for (int i = 0; i < n; i++){
        if(v[i] < h[i]){ 
            vv++; 
            }
        else {
            hh++;
            }
        if (v[i] < nn) {
            nn = v[i];
            ham = false;
        }
        else if (h[i] < nn) {
            nn = h[i];
            ham = true;
        }
    }
    if (vv > hh) std::cout<<"Verstappen"<<std::endl;
    else std::cout<<"Hamilton"<<std::endl;
    if (ham) std::cout<<"Hamilton";
    else std::cout<<"Verstappen";
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Wrong answer3ms1872 KiB
2Accepted3ms2120 KiB
subtask20/10
3Accepted3ms2336 KiB
4Wrong answer3ms2544 KiB
5Accepted3ms2796 KiB
6Wrong answer3ms2968 KiB
subtask30/15
7Wrong answer3ms3184 KiB
8Wrong answer3ms3372 KiB
9Accepted3ms3584 KiB
10Wrong answer3ms3828 KiB
11Wrong answer3ms4072 KiB
subtask40/20
12Wrong answer3ms4120 KiB
13Wrong answer3ms4148 KiB
14Accepted3ms4312 KiB
15Accepted3ms4400 KiB
16Wrong answer3ms4400 KiB
17Accepted3ms4408 KiB
18Accepted3ms4532 KiB
19Wrong answer2ms4412 KiB
subtask50/55
20Accepted3ms4380 KiB
21Accepted3ms4388 KiB
22Accepted3ms4516 KiB
23Wrong answer3ms4600 KiB
24Accepted2ms4716 KiB
25Accepted3ms4592 KiB
26Wrong answer3ms4596 KiB
27Wrong answer3ms4740 KiB
28Wrong answer3ms4596 KiB