swap.cpp:1:1: error: 'map' does not name a type
1 | map<pi,int> bes;
| ^~~
swap.cpp:2:10: error: 'MX' was not declared in this scope
2 | int n, p[MX];
| ^~
swap.cpp: In function 'int get(int, int)':
swap.cpp:5:9: error: 'bes' was not declared in this scope
5 | if (bes.count({ind,y})) return bes[{ind,y}];
| ^~~
swap.cpp:8:17: error: 'p' was not declared in this scope
8 | if (y > p[2*ind]) return 2*ind;
| ^
swap.cpp:11:17: error: 'p' was not declared in this scope
11 | if (y < min(p[2*ind],p[2*ind+1])) return bes[{ind,y}] = ind;
| ^
swap.cpp:11:13: error: 'min' was not declared in this scope
11 | if (y < min(p[2*ind],p[2*ind+1])) return bes[{ind,y}] = ind;
| ^~~
swap.cpp:11:46: error: 'bes' was not declared in this scope
11 | if (y < min(p[2*ind],p[2*ind+1])) return bes[{ind,y}] = ind;
| ^~~
swap.cpp:12:9: error: 'p' was not declared in this scope
12 | if (p[2*ind] < min(y,p[2*ind+1])) return bes[{ind,y}] = get(2*ind,y);
| ^
swap.cpp:12:20: error: 'min' was not declared in this scope
12 | if (p[2*ind] < min(y,p[2*ind+1])) return bes[{ind,y}] = get(2*ind,y);
| ^~~
swap.cpp:12:46: error: 'bes' was not declared in this scope
12 | if (p[2*ind] < min(y,p[2*ind+1])) return bes[{ind,y}] = get(2*ind,y);
| ^~~
swap.cpp:13:20: error: 'p' was not declared in this scope
13 | int mn = min(y,p[2*ind]);
| ^
swap.cpp:13:14: error: 'min' was not declared in this scope; did you mean 'mn'?
13 | int mn = min(y,p[2*ind]);
| ^~~
| mn
swap.cpp:15:29: error: 'bes' was not declared in this scope
15 | if (mn == y) return bes[{ind,y}] = get(2*ind,y);
| ^~~
swap.cpp:16:16: error: 'bes' was not declared in this scope
16 | return bes[{ind,y}] = get(2*ind+1,y);
| ^~~
swap.cpp:18:29: error: 'bes' was not declared in this scope
18 | if (mn == y) return bes[{ind,y}] = get(2*ind+1,y);
| ^~~
swap.cpp:19:16: error: 'bes' was not declared in this scope
19 | return bes[{ind,y}] = get(2*ind,y);
| ^~~
swap.cpp: In function 'void solve(int)':
swap.cpp:26:13: error: 'p' was not declared in this scope
26 | if (p[ind] > p[2*ind]) swap(p[ind],p[2*ind]);
| ^
swap.cpp:26:32: error: 'swap' was not declared in this scope
26 | if (p[ind] > p[2*ind]) swap(p[ind],p[2*ind]);
| ^~~~
swap.cpp:30:9: error: 'p' was not declared in this scope
30 | if (p[ind] < min(p[2*ind],p[2*ind+1])) {
| ^
swap.cpp:30:18: error: 'min' was not declared in this scope
30 | if (p[ind] < min(p[2*ind],p[2*ind+1])) {
| ^~~
swap.cpp:33:9: error: 'swap' was not declared in this scope
33 | swap(p[2*ind],p[ind]);
| ^~~~
swap.cpp:39:41: error: 'mx' was not declared in this scope; did you mean 'mn'?
39 | p[2*ind] = mn, p[2*ind+1] = mx;
| ^~
| mn
swap.cpp:41:24: error: 'mx' was not declared in this scope; did you mean 'mn'?
41 | p[2*ind] = mx, p[2*ind+1] = mn;
| ^~
| mn
swap.cpp: In function 'int main()':
swap.cpp:48:5: error: 'ios_base' has not been declared
48 | ios_base::sync_with_stdio(0); cin.tie(0);
| ^~~~~~~~
swap.cpp:48:35: error: 'cin' was not declared in this scope
48 | ios_base::sync_with_stdio(0); cin.tie(0);
| ^~~
swap.cpp:50:9: error: 'i' was not declared in this scope
50 | FOR(i,1,n+1) cin >> p[i];
| ^
swap.cpp:50:5: error: 'FOR' was not declared in this scope
50 | FOR(i,1,n+1) cin >> p[i];
| ^~~