Problem funnysequence
User ThePwo
Submission Time 2024-11-21 13:29:24
Score 0
Max Time N/A
Max Memory N/A

Compile Error

funnysequence.cpp:6:1: error: ‘vector’ does not name a type
6 | vector<int> v;
| ^~~~~~
funnysequence.cpp: In function ‘void init()’:
funnysequence.cpp:9:2: error: ‘v’ was not declared in this scope
9 | v.push_back(0);
| ^
funnysequence.cpp:13:31: error: ‘sqrt’ was not declared in this scope
13 | int val = idx * idx * idx + sqrt(v[idx - 1]) + sqrt(v[idx - 2]);
| ^~~~
funnysequence.cpp: In function ‘long long int query(long long int, long long int)’:
funnysequence.cpp:20:21: error: ‘v’ was not declared in this scope
20 | return upper_bound(v.begin(), v.end(), r) - lower_bound(v.begin(), v.end(), l);
| ^
funnysequence.cpp:20:9: error: ‘upper_bound’ was not declared in this scope
20 | return upper_bound(v.begin(), v.end(), r) - lower_bound(v.begin(), v.end(), l);
| ^~~~~~~~~~~
funnysequence.cpp:20:46: error: ‘lower_bound’ w