94652024-02-22 09:10:16TortelliniJrSzínes szobák (50 pont)cpp17Wrong answer 0/5032ms6700 KiB
#include <iostream>
#include <vector>
#include <array>
using namespace std;
// literally fully "loaned" code from njudge, i am far too stupid for this shit
int main()
{
    cin.tie(0), cin.sync_with_stdio(0);
    int szob, szin, ut;
    cin >> szob >> szin >> ut;
    vector<int> hell(szob + 2);
    for (int i = 0; i < szob; i++)
    {
        cin >> hell[i];
    }
    vector<array<int, 2>> uts(ut);
    for (int i = ut - 1; i >= 0; i--)
        cin >> uts[i][0] >> uts[i][1];
    int r = szob + 1;
    int l = 0;
    for (size_t i = 0; i < uts.size(); ++i) {
        int& x = uts[i][0];
        int& c = uts[i][1];
        if (x == -1 && c == hell[l + 1]) { l++; };
        if (x == 1 && c == hell[l]) { l--; };
        if (x == 1 && c == hell[r - 1]) { r--; };
        if (x == -1 && c == hell[r]) { r++; };
    }
    cout << (l - r + szob + 1);
}
SubtaskSumTestVerdictTimeMemory
base0/50
1Wrong answer0/03ms1828 KiB
2Wrong answer0/032ms4424 KiB
3Wrong answer0/13ms2280 KiB
4Wrong answer0/13ms2592 KiB
5Wrong answer0/13ms2804 KiB
6Wrong answer0/13ms2884 KiB
7Wrong answer0/13ms3004 KiB
8Wrong answer0/13ms3096 KiB
9Wrong answer0/13ms3184 KiB
10Wrong answer0/13ms3448 KiB
11Wrong answer0/13ms3508 KiB
12Wrong answer0/13ms3400 KiB
13Wrong answer0/14ms3476 KiB
14Wrong answer0/14ms3552 KiB
15Wrong answer0/14ms3608 KiB
16Wrong answer0/14ms3836 KiB
17Wrong answer0/14ms4096 KiB
18Wrong answer0/16ms4144 KiB
19Wrong answer0/119ms5368 KiB
20Wrong answer0/132ms6424 KiB
21Wrong answer0/124ms5840 KiB
22Wrong answer0/126ms5964 KiB
23Wrong answer0/129ms5972 KiB
24Wrong answer0/132ms6364 KiB
25Wrong answer0/132ms6420 KiB
26Wrong answer0/130ms6420 KiB
27Wrong answer0/332ms6568 KiB
28Wrong answer0/330ms6504 KiB
29Wrong answer0/330ms6652 KiB
30Wrong answer0/330ms6700 KiB
31Wrong answer0/330ms6420 KiB
32Wrong answer0/330ms6424 KiB
33Wrong answer0/417ms4928 KiB
34Wrong answer0/427ms5840 KiB