Problem | segmenttree |
---|---|
User | Samyeobeo |
Submission Time | 2025-09-20 16:28:54 |
Score | 0 |
Max Time | N/A |
Max Memory | N/A |
Owl Get a Life
segmenttree.cpp:42:4: error: ISO C++ forbids declaration of ‘root’ with no type [-fpermissive]
42 | } *root;
| ^~~~
segmenttree.cpp:57:1: error: expected ‘}’ at end of input
57 | }
| ^
segmenttree.cpp:3:12: note: to match this ‘{’
3 | struct node{
| ^
segmenttree.cpp: In member function ‘int node::main()’:
segmenttree.cpp:47:9: error: cannot convert ‘node*’ to ‘int*’ in assignment
47 | root = new node(0, n-1);
| ^~~~~~~~~~~~~~~~
| |
| node*
segmenttree.cpp:53:12: error: request for member ‘update’ in ‘*((node*)this)->node::root’, which is of non-class type ‘int’
53 | root -> update(b,c);
| ^~~~~~
segmenttree.cpp:55:18: error: request for member ‘rmq’ in ‘*((node*)this)->node::root’, which is of non-class type ‘int’
55 | cout << root->rmq(b,c) << '\n';
| ^~~
segme