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

Автор StellarSpecter, история, 4 дня назад, По-английски

After trying so hard, I could not solve problem A or problem B today, they were both so hard, help me how could i have solved it.

I thought there would be some logical solution for A, i thought of using STack, binary search in problem A.

But the solution is loops for 100 times? I dont understand what is purpose of such problems.

I want to quit cp after today.

ANy tips on how to solve problems will be appreciated.

Thanks

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

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

udgm should help you

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

Solving problems like A and B can actually be disheartening to face at times. Note that problem difficulties are not precisely consistent across contests (i.e. div2 A and B in contest 1 may be much easier than A and B in div2 contest 2). If you look at the standings, people generally struggled with A and B for a little while -- more than usual. I also did. I recommend 2 things then:

  • Systematic process of thinking. This refers to solving problems by repeating a 2 step process again and again: (1) make observations, (2) what is the next intuitive step from here (e.g. different cases, something needs to be optimized). This applies to B in particular from today's contest, but all problems roughly require this pattern of thought.

  • Contest strategy. This refers to jumping between problems depending on your strengths and weaknesses in problem topics or perhaps depending on the particular problem. I spent 30 mins on A and B without solving them, then jumped to C and solved that in a few minutes since I know binary search very well. Then I gained some confidence in the time I had left to take the time to solve A and B.

In all cases, keep practicing -- I know losses can be disheartening.

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

In Problem B, observe that the array a would be a arithmatic progression so you may notice one thing that all the unwanted numbers are to be converted to wanted numbers for example=> The n=7,b=2,c=1 then array would be a=[1,3,5,7,9,11,13] you can see that the unwanted numbers are [7,9,11,13] so you will have to eliminate them which would take 4 operations. So the answer would be the number of unwanted elements which could be easily calculated by using the formula n-floor((n-1-c)/b)+1 (Derived from the ap formula for nth term a+(n-1)*d=nth term). Then there were a few edge cases if all numbers are same that is b=0 then if c=n-2&&c<n then you would need n-1 operations else in other cases you will take n operations (you may take examples and see this).

And don't quit brother, sometimes it happens keep trying

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

pretty much a womp-womp situation, seeing you submitting problems once in different languages with AI-lookalike variable names and all other stuff

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

Good for u