prog.cpp:2:1: error: ‘ll’ does not name a type
ll check(int x, int y) {
^~
prog.cpp: In function ‘void solve()’:
prog.cpp:14:5: error: ‘cin’ was not declared in this scope
cin >> n;
^~~
prog.cpp:20:5: error: ‘vector’ was not declared in this scope
vector<int> pre(n + 1, n);
^~~~~~
prog.cpp:20:12: error: expected primary-expression before ‘int’
vector<int> pre(n + 1, n);
^~~
prog.cpp:22:17: error: ‘pre’ was not declared in this scope
nx[i] = pre[c[i]];
^~~
prog.cpp:25:5: error: ‘cout’ was not declared in this scope
cout << check(0, n - 1) + 1 << '\n';
^~~~
prog.cpp:25:13: error: ‘check’ was not declared in this scope
cout << check(0, n - 1) + 1 << '\n';
^~~~~