pair with pair?

Правка en1, от 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?

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский altrko 2024-08-27 16:51:59 464 Initial revision (published)