kznil96's blog

By kznil96, history, 4 years ago, In English

My submission #84516509 for question B of Codeforces Round 651 (Div 2) passed the pretests but failed the system test.

From what I understood, this usually means that successful hacks were presented during the hacking phase/ competition itself and my solution fails on the hack cases.

However, from what I can see, there are 0 successful hacking attempts for this problem throughout the course of the competition.

Can anyone shed light on what happened (solution passes pretests but fail system tests with 0 successful hacking attempts) ? It is quite discouraging (the bug was minor which resulted in runtime error, and I promptly spotted and fixed it as soon as system testing is over) that I was initially expecting a delta positive from this contest the moment it is over, but judging from my ranking after the system test, it is likely to be a delta negative instead.

(P/S: Needless to say, I did not use any randomised algorithm/ functions which would result in a different output. All output were exactly reproducible and is dependent on the input only.)

Full text and comments »

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

By kznil96, history, 4 years ago, In English

Below is a code I wrote for Atcoder dynamic programming contest problem B. The result returns TLE for 3 out of 16 test cases.

Problem: link to problem

image of problem

Code (python):

image of my code

The approach is just standard DP, with complexity of N times K.

Based on me looking around, a lot of people have submitted similar solutions with accepted verdict.

Can anyone tell me why is it that the code above exceed time limit, and suggest improvements? (maybe it has to do with ways of reading input etc)

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it