Problem deathray
User Duk168
Submission Time 2024-10-22 11:13:38
Score 0
Max Time N/A
Max Memory N/A

Compile Error

deathray.cpp: In member function ‘bool vol::compare(const vol&, const vol&)’:
deathray.cpp:6:14: error: ‘const struct vol’ has no member named ‘life’
6 | return a.life > b.life;
| ^~~~
deathray.cpp:6:23: error: ‘const struct vol’ has no member named ‘life’
6 | return a.life > b.life;
| ^~~~
deathray.cpp: In function ‘int main()’:
deathray.cpp:24:29: error: no matching function for call to ‘std::priority_queue<vol, std::vector<vol>, std::greater<vol> >::push(<brace-enclosed initializer list>)’
24 | pq.push({life[i], i});
| ^
In file included from /usr/include/c++/9/queue:64,
from /usr/include/x86_64-linux-gnu/c++/9/bits/stdc++.h:86,
from deathray.cpp:1:
/usr/include/c++/9/bits/stl_queue.h:627:7: note: candidate: ‘void std::priority_queue<_Tp, _Sequence, _Compare>::push(c