Пожалуйста, прочтите новое правило об ограничении использования AI-инструментов. ×

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

Автор algoacer, история, 12 месяцев назад, По-английски

I have been stuck in this situation for sometime. Actually I get the logic for solving 2.B in sufficient time but am stuck in one or two pretest. Like for the submission, I am not able to resolve the issue (pretest 5). Please suggest some good practices and how to build logic taking care of corner cases, or writing efficient code.

My submission is: https://codeforces.me/contest/1877/submission/227200089

Please help me taking example for this problem.

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

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

one thing that I do is that whenever you are making an integer variable make it a long long because it is always better than realising latter that you should have made a long long after getting a wrong solution verdict

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

I don't know whether I am qualified to tell you this or not. But to be able to visualize various testcases and its structure is a skill. you just have to use pen and paper to feel the testcase.