Problem buyingcandy
User lucaleeeeee
Submission Time 2026-11-09 15:20:18
Score 0
Max Time N/A
Max Memory N/A

Compile Error

buyingcandy.cpp: In function ‘int main()’:
buyingcandy.cpp:22:22: error: ‘m’ was not declared in this scope
22 | while (ptr < m && vouchers[ptr].first <= p[i]) {
| ^
buyingcandy.cpp:22:27: error: ‘vouchers’ was not declared in this scope
22 | while (ptr < m && vouchers[ptr].first <= p[i]) {
| ^~~~~~~~
buyingcandy.cpp:22:50: error: ‘p’ was not declared in this scope
22 | while (ptr < m && vouchers[ptr].first <= p[i]) {
| ^
buyingcandy.cpp:23:34: error: request for member ‘second’ in ‘ptr’, which is of non-class type ‘long long int’
23 | pq.push(vouchers[ptr.second]);
| ^~~~~~
buyingcandy.cpp:26:25: error: ‘sum’ was not declared in this scope
26 | if (pq.empty()) sum += p[i];
| ^~~
buy