Блог пользователя Jady

Автор Jady, история, 2 года назад, По-английски

Problem: Facetook Priority Wall

Accepted Solution: Accepted
Runtime error on test case 18: Runtime error

Only main difference between the two submission is of how we implement comparison. Thoughts?
ps: codeforces rookie here, please don't downvote me :)

  • Проголосовать: нравится
  • +8
  • Проголосовать: не нравится

»
2 года назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Your comparator is wrong in a case where c.ss < n.ss and c.ff = n.ff. In this case comparator will return that n = s but it isn't so. When we make a comparator we need to compare all properties of the objects we compare. For example the correct comparator for this case is looking like this bool cmp(pair<string, int> c, pair<string, int> n){ if(c.ss != n.ss) return c.ss > n.ss; return c.ff < n.ff; }

»
2 года назад, # |
Rev. 2   Проголосовать: нравится 0 Проголосовать: не нравится

https://codeforces.com/blog/entry/70237?f0a28=1

Maybe there is any point to somehow pin forever hints like that