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

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

Hi,

Have been trying this problem for 4 days now. My solution is the same as that provided in the editorial but I just keep getting WA :/

I have checked my solution with thousands of small test cases and a python brute force solution (with n upto 100) and it has matched all of them.

Here is my C++ code. (I have added comments to the main sections of my logic)

This is my brute force python solution

And this is the test case generator

Kindly help me. Thank you! :)

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

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

Since K can be up to , it cannot fit into int.