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

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

Hi everyone, On the recent codeforces round, I can't for the life of me figure out why my code is wrong.

My approach is to first compress all of ai and bi into at numbers that are at most 2 * 105 and then store dp[i]=highest possible height obtainable with topmost ring with i inner width. I update this by iterating through the input by nonincreasing b, using a binary indexed tree to find the max of the elements from 1 to the compressed bi - 1 of dp.

Any help would be appreciated.

EDIT: Hi everyone, I am curious as to why this post is being downvoted. I am not complaining, but I would like to know for the future, are these type of debugging posts frowned upon? If yes, where should I ask inquiries such as for debugging? Thanks!

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

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

dp[mp[r[i].second.first]] = max(dp[i], get(mp[r[i].first] — 1) + r[i].second.second);

Why are you comparing dp[mp[r[i].second.first]] with dp[i] ?

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

    Ah nice catch :) What's weird though is that I still WA after fixing it, so it seems I have multiple bugs in my code?

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

Auto comment: topic has been updated by memeset (previous revision, new revision, compare).

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

Hey brother, this is Codeforces, you never know where the down-votes come :3

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

    Unfortunately, I find that this is sometimes true. I think that some people downvote without reading because after I edited my post to ask a question, noone responded but still there were downvotes. I'm not complaining about the downvotes per se, but sometimes I find it difficult to communicate on this site.