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

Compile Error

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