pair with pair?

Revision en1, by altrko, 2024-08-27 16:51:59

recently i solved a problem which needed some answers on given pairs (each one of them) and i did it on sorted pairs and only normal way to get my answer (on unsorted pairs) was to create pair <pair<int,int>,int> p[2e5]. third int was for the index of unsorted pairs. so by sorting the pairs ,index automatically followed it and eventually i did it but code got messy and "time consuming" like p[i].first.second. Is there a better way of doing this?

History

 
 
 
 
Revisions
 
 
  Rev. Lang. By When Δ Comment
en1 English altrko 2024-08-27 16:51:59 464 Initial revision (published)