Problem sandwich
User Pan
Submission Time 2024-08-02 21:09:19
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sandwich.cpp: In function ‘int main()’:
sandwich.cpp:101:8: error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’
101 | input(n); input(q);
| ^
sandwich.cpp:82:17: note: initializing argument 1 of ‘void input(int&)’
82 | void input(int &x) {
| ~~~~~^
sandwich.cpp:101:18: error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’
101 | input(n); input(q);
| ^
sandwich.cpp:82:17: note: initializing argument 1 of ‘void input(int&)’
82 | void input(int &x) {
| ~~~~~^
sandwich.cpp:102:35: error: cannot bind non-const lvalue reference of type ‘int&’ to an rvalue of type ‘int’
102 | for (ll i=1; i<=n; ++i) input(a[i]);
| ~~~^
sandwich.cpp:82:17: note: initializing argument 1 of ‘void input(int&)’
82 | void input(int &x) {
| ~~~~~