secret.cpp:10:17: error: expected declaration before '}' token
10 | int arr[1005]; }
| ^
secret.cpp:11:5: error: expected unqualified-id before 'if'
11 | if(ini == fin-1){
| ^~
secret.cpp:16:16: error: 'ini' was not declared in this scope; did you mean 'int'?
16 | int mitad=(ini+fin)/2;
| ^~~
| int
secret.cpp:16:20: error: 'fin' was not declared in this scope
16 | int mitad=(ini+fin)/2;
| ^~~
secret.cpp:17:5: error: 'tree' does not name a type
17 | tree[pos][mitad-1]=arr[mitad-1];
| ^~~~
secret.cpp:18:5: error: expected unqualified-id before 'for'
18 | for(int c=mitad-2; c >= ini; c--){
| ^~~
secret.cpp:18:24: error: 'c' does not name a type
18 | for(int c=mitad-2; c >= ini; c--){
| ^
secret.cpp:18:34: error: 'c' does not name a type
18 | for(int c=mitad-2; c >= ini; c--){
| ^
secret.cpp:21:5: error: 'tree' does not name a type
21 | tree[pos][mitad]=arr[mitad];
| ^~~~
secret.cpp:22:5: error: expected unqualified-id before 'for'
22 | for(int c=mitad+1; c <= fin; c++){
| ^~~
secret.cpp:22:24: error: 'c' does not name a type
22 | for(int c=mitad+1; c <= fin; c++){
| ^
secret.cpp:22:34: error: 'c' does not name a type
22 | for(int c=mitad+1; c <= fin; c++){
| ^
secret.cpp:25:17: error: expected constructor, destructor, or type conversion before '(' token
25 | segment_tree(pos*2, ini, mitad);
| ^
secret.cpp:26:17: error: expected constructor, destructor, or type conversion before '(' token
26 | segment_tree(pos*2+1, mitad+1, fin);
| ^
secret.cpp:27:1: error: expected declaration before '}' token
27 | }
| ^
secret.cpp: In function 'void Init(int, int*)':
secret.cpp:30:5: error: 'tam' was not declared in this scope; did you mean 'tm'?
30 | tam=N;
| ^~~
| tm
secret.cpp:34:5: error: 'segment_tree' was not declared in this scope
34 | segment_tree(1, 0, N-1);
| ^~~~~~~~~~~~
secret.cpp: In function 'int Query(int, int)':
secret.cpp:58:24: error: 'tam' was not declared in this scope; did you mean 'tm'?
58 | return ayuda(1, 0, tam-1, L, R);
| ^~~
| tm