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

Автор Bakry, история, 7 лет назад, По-английски

There's Wrong Answer on test case 14 I tried to solve it But What's in Code wrong that lead to print 146 instead of 120 Code : https://ideone.com/gwUN8C Problem : http://codeforces.com/contest/186/problem/B Submission : http://codeforces.com/contest/186/submission/30480217

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

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

The problem is that your output did not follow this criteria

In case of equal mushroom heights, the participants are sorted by their numbers (the participants with a smaller number follow earlier).

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

    I tried for that and when I debug that it sort with numbers

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

      I dont understand what you are talking about. But here you go, just change sort to stable sort, and it will work.

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

        I was talking about when I debugged it it sort by earlier But , Thanks for you because you helped me to know stable sort :D