Problem party
User tacticalnerd
Submission Time 2024-08-27 20:37:32
Score 0
Max Time N/A
Max Memory N/A

Compile Error

party.cpp: In function ‘int main()’:
party.cpp:20:19: error: invalid initialization of reference of type ‘int&’ from expression of type ‘std::pair<int, int>’
20 | for (int& p : tree) {
| ^~~~
party.cpp:21:19: error: request for member ‘first’ in ‘p’, which is of non-class type ‘int’
21 | int i = p.first;
| ^~~~~
party.cpp:22:19: error: request for member ‘second’ in ‘p’, which is of non-class type ‘int’
22 | int j = p.second;
| ^~~~~~
party.cpp:31:19: error: invalid initialization of reference of type ‘int&’ from expression of type ‘std::pair<int, int>’
31 | for (int& p : tree) {
| ^~~~
party.cpp:32:19: error: request for member ‘first’ in ‘p’, which is of non-class type ‘int’
32 | int i = p.first;
| ^~~~~
party.cpp:33:19: error: request for member ‘second’ in ‘p