Please subscribe to the official Codeforces channel in Telegram via the link https://t.me/codeforces_official. ×

iit_ya_ism's blog

By iit_ya_ism, history, 4 years ago, In English

I submitted solution 77669161 for problem 2B - The least round way and got TLE at test case 31 and not able to find reason. Could anyone help me in finding why it is getting tle error.

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

| Write comment?
»
4 years ago, # |
  Vote: I like it 0 Vote: I do not like it

Hey, I couldn't figure out why you TLE (I've been looking at your code for 15+ mins). Instead, I'll share my code that ACed, and hopefully you can compare and figure out.

PS: I really liked this problem when I first read it (maybe last month), and it's been one of my favourites till now.

Code
  • »
    »
    4 years ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    thanks, I found out reason of tle as I didn't noticed numbers of grid can be zero also,my silly mistake :(