Problem ring2
User Informatics271
Submission Time 2026-03-11 08:08:52
Score 0
Max Time N/A
Max Memory N/A

Compile Error

ring2.cpp: In member function ‘int UFDS::qry(int)’:
ring2.cpp:20:14: error: request for member ‘back’ in ‘((UFDS*)this)->UFDS::par[x]’, which is of non-class type ‘int’
20 | if (par[x].back()==x) return x;
| ^~~~
ring2.cpp: In member function ‘int UFDS::mrg(int, int)’:
ring2.cpp:27:37: error: expected ‘;’ before ‘par’
27 | hst.push_back({t,{par[x],par[x]}})
| ^
| ;
28 | par[x]=y;
| ~~~
ring2.cpp: In member function ‘void UFDS::roll(int)’:
ring2.cpp:35:70: error: cannot convert ‘std::pair<int&, int>’ to ‘int’ in assignment
35 | while (hst.size()&&hst.back().first>t) hst.back().first=hst.back().second,hst.pop_back();
| ~~~~~~~~~~~^~~~~~
|