Codeforces Round 1133 (Div. 1, Div. 2) is coming soon! Register here. ×

ghee_khatam's blog

By ghee_khatam, history, 14 months ago, In English

Hi everyone,

I have submitted a solution to the recent Codeforces Round 1045 Div 2 problem B (which was Add 0 or K) and my solution looks

similar to the editorial solution 2 yet my solution is giving TLE and Editorial code is getting Accepted can anyone guide me.

Link to my submission : https://codeforces.me/contest/2134/submission/335714240

update : orz qwertylkjhg pointed out the error and now it is Accepted.

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

| Write comment?
»
14 months ago, hide # |
 
Vote: I like it 0 Vote: I do not like it

You should remove 9 from x. In a test case, where k is divisible by 210 and not divisible by 9, if some a[i] is not divisible by 3, while loop will run infinitely.