memeset's blog

By memeset, history, 8 years ago, In English

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!

  • Vote: I like it
  • -9
  • Vote: I do not like it

»
8 years ago, # |
  Vote: I like it +3 Vote: I do not like it

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

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

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

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

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

  • »
    »
    8 years ago, # ^ |
      Vote: I like it +1 Vote: I do not like it

    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.