9462 | 2024-02-22 08:59:55 | TortelliniJr | Színes szobák (50 pont) | cpp17 | Compilation error |
#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 (auto &[c, x] : uts) {
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)
}
exit status 1
main.cpp: In function 'int main()':
main.cpp:30:31: error: expected ';' before '}' token
30 | cout << (l - r + szob + 1)
| ^
| ;
31 | }
| ~
Exited with error status 1