Codeforces и Polygon могут быть недоступны в период с 23 мая, 7:00 (МСК) по 23 мая, 11:00 (МСК) в связи с проведением технических работ. ×

comparison functions and classes/structs

Правка en1, от arjun_9426, 2018-12-19 17:26:21

hello friend, i suffer a lot because of comparison functions and classes for sorting and STL data structures please help me in clearing this

comparison functions ex-> (1).when i try to sort using comparison function like->https://ideone.com/owtUzJ here problem comes when i try to sort according to my wish (2). sometimes even vectors of simple numbers give TLE or runtime error when i try to sort them using comparision function eg->https://ideone.com/FhzWw2

classes and structs https://ideone.com/FhzWw2 in this case it reinsert the value???

https://ideone.com/0POMaG in this case it reinsert the key value pair instead of just updating it???

https://ideone.com/Ae2DMR(another example where entry repeats)

please help me in this, i have suffered a lot because of this, recent one is (1)https://codeforces.com/contest/1082/submission/47244078(runtime error) (2)https://codeforces.com/contest/1082/submission/47244104(accepted) both codes are exactly same, i have just managed the comparison function benefits through extra code in 2nd one.

please somebody tell if there is any other way to use these functions/structs more effectively, else what and how we can use them . please somebody help

История

 
 
 
 
Правки
 
 
  Rev. Язык Кто Когда Δ Комментарий
en1 Английский arjun_9426 2018-12-19 17:26:21 1289 Initial revision (published)