63182023-11-15 16:57:21Pbg4444Formula-1cpp17Wrong answer 10/1003ms3792 KiB
#include <iostream>
#include <string>

int main(){
    int n;
    std::cin>>n;
    int v[n], h[n];
    int vv=0;
    int hh=0;
    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 answer3ms1748 KiB
2Accepted3ms1996 KiB
subtask210/10
3Accepted3ms2252 KiB
4Accepted3ms2460 KiB
5Accepted3ms2668 KiB
6Accepted3ms2884 KiB
subtask30/15
7Accepted3ms2960 KiB
8Wrong answer3ms3060 KiB
9Accepted3ms3272 KiB
10Wrong answer3ms3512 KiB
11Wrong answer2ms3636 KiB
subtask40/20
12Accepted3ms3660 KiB
13Accepted3ms3516 KiB
14Accepted3ms3508 KiB
15Accepted3ms3632 KiB
16Accepted3ms3512 KiB
17Accepted3ms3784 KiB
18Accepted3ms3672 KiB
19Wrong answer3ms3792 KiB
subtask50/55
20Accepted3ms3560 KiB
21Accepted3ms3668 KiB
22Accepted3ms3664 KiB
23Accepted3ms3664 KiB
24Accepted3ms3784 KiB
25Accepted2ms3788 KiB
26Wrong answer3ms3788 KiB
27Accepted3ms3788 KiB
28Wrong answer3ms3788 KiB