Bakry's blog

By Bakry, history, 7 years ago, In English

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.net/contest/186/problem/B Submission : http://codeforces.net/contest/186/submission/30480217

  • Vote: I like it
  • +1
  • Vote: I do not like it

»
7 years ago, # |
  Vote: I like it 0 Vote: I do not like it

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 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

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

    • »
      »
      »
      7 years ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

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

      • »
        »
        »
        »
        7 years ago, # ^ |
          Vote: I like it 0 Vote: I do not like it

        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