rangerscowboys's blog

By rangerscowboys, history, 3 weeks ago, In English

Hello Codeforces!

On today's contest, Codeforces Global Round 26, I lost a ton of rating because of many Wrong Answers and I was very slow today. Does anyone have any tips for avoiding wrong answers? Does anyone have any tips for getting faster at solving the easier problems?

Also, for today's C1, it took me forever to come up with the idea for how to solve it. When I solved it, I was so frustrated because of how simple it was. Do any of you have a way of looking at problems that helps you solve it? I've noticed that easier problems tend to have a greedy/brute force solution to it. Do you notice any tendencies of greedy methods?

Thanks!

UPD: Even if you think that I am stupid and downvote, please answer my questions to the best of your ability. Thanks again!

Full text and comments »

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

By rangerscowboys, history, 2 months ago, In English

Howdy Codeforces!

Recently, while solving previous Codefoces problems, I have seen many query problems. What I mean by query problems are: you are given q queries, like updating and printing something.

This is what I have gathered from query problems: - Arrays can be used for simple query problems. - Prefix sums can sometimes be used for query problems (No Updates Ranged Query) - Sets/Multisets are often used for query problems that need O(logn) operations. - Ordered set is used for some query problems (Point Update Range Query) - Segment tree (with lazy propagation on ranged updates) can be used often for Point Update Range Query, Range Update Point Query, Range Update Range Query.

Of course, although segment tree is a solution for many query problems, it isn't easy to code, especially for specialists like me.

Me personally, I have started to direct myself to thinking set/multiset first, because it seems to often work.

Did I miss any ways to solve query problems? Does anyone have a segment tree template that I can use (with lazy propagation)? Do you all have a different approach to query problems than what I do? What do you all see most often as the solution to query problems?

Thanks!

Full text and comments »

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

By rangerscowboys, history, 4 months ago, In English

I was working on today's contest, Codeforces Round 933 (Div. 3). On problem F, I had gotten a Runtime Error. I spent over an hour debugging it, and finally did, but wasted a lot of time. It turned out my issue was having an empty set and doing operations on it. skul

Is there any way to quickly find where is your Runtime Error in your code? I have gotten Runtime Error multiple times, and debugging is always the most annoying part. skul

Thanks!

Full text and comments »

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