xylophone.cpp:1:16: error: 'n' was not declared in this scope
1 | int l = 1, r = n;
| ^
xylophone.cpp:2:5: error: expected unqualified-id before 'while'
2 | while(l != r){
| ^~~~~
xylophone.cpp:8:13: error: 'n' was not declared in this scope
8 | int ans[n+1], ans2[n+1];
| ^
xylophone.cpp:8:24: error: 'n' was not declared in this scope
8 | int ans[n+1], ans2[n+1];
| ^
xylophone.cpp:9:5: error: expected unqualified-id before 'for'
9 | for(int i = 0; i <= n; i++) ans2[i] = -1;
| ^~~
xylophone.cpp:9:20: error: 'i' does not name a type
9 | for(int i = 0; i <= n; i++) ans2[i] = -1;
| ^
xylophone.cpp:9:28: error: 'i' does not name a type
9 | for(int i = 0; i <= n; i++) ans2[i] = -1;
| ^
xylophone.cpp:10:5: error: 'ans' does not name a type
10 | ans[l] = 1;
| ^~~
xylophone.cpp:11:5: error: 'ans2' does not name a type
11 | ans2[1] = l;
| ^~~~
xylophone.cpp:12:5: error: expected unqualified-id before 'if'
12 | if(l != n) ans[l+1] = query(l, l+1) + 1, ans2[ans[l+1]] = l+1;
| ^~
xylophone.cpp:14:5: error: expected unqualified-id before 'for'
14 | for(int i = l+2; i <= n; i++){
| ^~~
xylophone.cpp:14:22: error: 'i' does not name a type
14 | for(int i = l+2; i <= n; i++){
| ^
xylophone.cpp:14:30: error: 'i' does not name a type
14 | for(int i = l+2; i <= n; i++){
| ^
xylophone.cpp:46:5: error: expected unqualified-id before 'if'
46 | if(l != 1) ans[l-1] = query(l-1, l) + 1, ans2[ans[l-1]] = l-1;
| ^~
xylophone.cpp:47:5: error: expected unqualified-id before 'for'
47 | for(int i = l-2; i; i--){
| ^~~
xylophone.cpp:47:22: error: 'i' does not name a type
47 | for(int i = l-2; i; i--){
| ^
xylophone.cpp:47:25: error: 'i' does not name a type
47 | for(int i = l-2; i; i--){
| ^
xylophone.cpp:79:5: error: expected unqualified-id before 'for'
79 | for(int i = 1; i <= n; i++) answer(i, ans[i]);
| ^~~
xylophone.cpp:79:20: error: 'i' does not name a type
79 | for(int i = 1; i <= n; i++) answer(i, ans[i]);
| ^
xylophone.cpp:79:28: error: 'i' does not name a type
79 | for(int i = 1; i <= n; i++) answer(i, ans[i]);
| ^