27692023-01-23 16:24:44georgeousVideójátékcpp11Wrong answer 0/100182ms13960 KiB
#include <bits/stdc++.h>
using namespace std;

int main()
{
    long long t, n, m, x;
    cin >> t >> n;
    vector<long long> me;
    vector<long long> hano;
    me.push_back(-1);
    me.push_back(-1);
    hano.push_back(-1);
    hano.push_back(-1);
    for (long long i = 0; i < n; i++)
    {
        cin >> x;
        me.push_back(x);
        cin >> x;
        me.push_back(x);
    }
    cin >> m;
    for (long long i = 0; i < m; i++)
    {
        cin >> x;
        hano.push_back(x);
        cin >> x;
        hano.push_back(x);
    }
    long long meind = 1, hanoind = 1;

    long long playtime = 0;

    while (meind <= n && hanoind <= m)
    {
        if (max(hano[2*hanoind - 1] + 1,me[2*meind]) + t + 1 >= hano[2*hanoind+1])
        {
            playtime += max(hano[2 * hanoind], me[2 * meind]) - min(hano[2 * hanoind + 1], me[2 * meind + 1]);
            if (me[2*meind + 1] < hano[2*hanoind + 1])
            {
                meind++;
            }
            else
            {
                hanoind++;
            }
        }
        else
        {
            meind++;
        }
    }

    cout << playtime << '\n';
}
SubtaskSumTestVerdictTimeMemory
subtask10/0
1Accepted3ms1680 KiB
2Wrong answer2ms1848 KiB
subtask20/10
3Accepted2ms2088 KiB
4Accepted2ms2172 KiB
5Accepted2ms2296 KiB
6Wrong answer2ms2500 KiB
7Wrong answer2ms2756 KiB
8Wrong answer2ms2828 KiB
9Accepted2ms3072 KiB
10Wrong answer2ms2988 KiB
11Wrong answer2ms3116 KiB
subtask30/20
12Wrong answer2ms3188 KiB
13Wrong answer2ms3440 KiB
14Wrong answer2ms3520 KiB
15Wrong answer2ms3492 KiB
16Wrong answer2ms3568 KiB
17Wrong answer3ms3688 KiB
18Wrong answer3ms3600 KiB
19Wrong answer4ms3800 KiB
20Wrong answer3ms3856 KiB
21Wrong answer3ms4112 KiB
22Wrong answer2ms4168 KiB
subtask40/30
23Wrong answer14ms5216 KiB
24Wrong answer50ms7064 KiB
25Wrong answer123ms13096 KiB
26Wrong answer138ms13608 KiB
27Wrong answer144ms13608 KiB
28Wrong answer54ms8548 KiB
29Wrong answer10ms4812 KiB
30Wrong answer9ms4808 KiB
31Wrong answer7ms4860 KiB
subtask50/40
32Wrong answer16ms5552 KiB
33Wrong answer61ms7352 KiB
34Wrong answer114ms10644 KiB
35Wrong answer162ms13504 KiB
36Wrong answer182ms13696 KiB
37Wrong answer182ms13960 KiB
38Wrong answer93ms9776 KiB
39Wrong answer115ms13132 KiB
40Wrong answer28ms6800 KiB
41Wrong answer43ms7148 KiB