94632024-02-22 09:03:18TortelliniJrSzínes szobák (50 pont)cpp17Wrong answer 0/5032ms7360 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 = 0, l = szob + 1;
    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/032ms4440 KiB
3Wrong answer0/13ms2292 KiB
4Wrong answer0/13ms2500 KiB
5Wrong answer0/13ms2672 KiB
6Wrong answer0/13ms2752 KiB
7Wrong answer0/13ms3124 KiB
8Wrong answer0/13ms3188 KiB
9Wrong answer0/13ms3276 KiB
10Wrong answer0/13ms3624 KiB
11Wrong answer0/13ms3616 KiB
12Wrong answer0/13ms3724 KiB
13Wrong answer0/14ms3900 KiB
14Wrong answer0/14ms4108 KiB
15Wrong answer0/14ms4316 KiB
16Wrong answer0/14ms4320 KiB
17Wrong answer0/14ms4464 KiB
18Wrong answer0/14ms4580 KiB
19Wrong answer0/119ms5640 KiB
20Wrong answer0/132ms6792 KiB
21Wrong answer0/124ms6436 KiB
22Wrong answer0/126ms6676 KiB
23Wrong answer0/129ms6708 KiB
24Wrong answer0/132ms7104 KiB
25Wrong answer0/132ms7004 KiB
26Wrong answer0/130ms7056 KiB
27Wrong answer0/330ms7124 KiB
28Wrong answer0/330ms7056 KiB
29Wrong answer0/330ms7312 KiB
30Wrong answer0/330ms7360 KiB
31Wrong answer0/330ms7308 KiB
32Wrong answer0/330ms7220 KiB
33Wrong answer0/417ms5796 KiB
34Wrong answer0/427ms6704 KiB