63152023-11-15 16:54:26Pbg4444Formula-1cpp17Wrong answer 0/1003ms4844 KiB
#include <iostream>
#include <string>

int main(){
    int n;
    std::cin>>n;
    int v[n], h[n];
    int vv;
    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
1Accepted3ms1876 KiB
2Wrong answer3ms2068 KiB
subtask20/10
3Wrong answer3ms2152 KiB
4Accepted3ms2416 KiB
5Wrong answer3ms2536 KiB
6Accepted3ms2748 KiB
subtask30/15
7Accepted3ms2984 KiB
8Accepted3ms3104 KiB
9Wrong answer3ms3212 KiB
10Wrong answer3ms3084 KiB
11Accepted3ms3332 KiB
subtask40/20
12Accepted2ms3388 KiB
13Accepted3ms3384 KiB
14Wrong answer3ms3608 KiB
15Wrong answer3ms3852 KiB
16Accepted3ms3952 KiB
17Wrong answer3ms4192 KiB
18Wrong answer3ms4400 KiB
19Accepted3ms4480 KiB
subtask50/55
20Wrong answer3ms4376 KiB
21Wrong answer3ms4384 KiB
22Wrong answer3ms4428 KiB
23Accepted3ms4428 KiB
24Wrong answer3ms4432 KiB
25Wrong answer3ms4440 KiB
26Accepted3ms4636 KiB
27Accepted3ms4844 KiB
28Accepted3ms4816 KiB