DESTCELL - Editorial

How did you get full score? The time for the last test case is 3.52s for your code, however the limit is 2.5s!

there is no need of set, bitset or map it can be done without these
check my sol: CodeChef: Practical coding for everyone

Java has a Multiplier of 2x… So, 2*2.5 = 5s

They have changed the Multiplier for python and now I think its 2.5x.(Not sure)

There is a fault in line-107.
Listen, you are filling 10^6 elements=0 for each ‘k’ , total time complexity :- O(10^6.k) , where k=10^6 , which is truly terrible,
keep track of places where you put a[i][j]=1, after you have solved it for a particular ‘k’ , make those particular indices (i,j) , i.e , a[i][j]=0; this will save lots of wasted time!

1 Like

https://www.codechef.com/viewsolution/26210572
solved in nmlog(n*m) still getting tle in 1 subtask.
Can anyone tell why.

Using map, makes your actual complexity :- NM.log(n.m).log(n.m)
Remove maps.

1 Like

Thanx!!:slightly_smiling_face:

1 Like

Okay I will try to do it now. Thank you for looking into my code.

Can someone pls tell me why I’m getting a RE?

Check the output of your program after addding the debugging code at line 35.

https://ideone.com/FN282S

Your program is incorrectly changing the row index i and the column index j.

The following is a slight update to your program which fixes the row index and column index problems, and correctly destroys and counts the destroyed cells in the grid.

https://www.codechef.com/viewsolution/26239446

Check the previous post.

@taran_1407 - thanks for the Editorial! Can you please remove the superfluous “L” from the thread Title? It’s really bugging me XD

“DESTCELLL - Editorial” :slight_smile:

Edit:

Phew - that’s better :slight_smile:

Edit2:

May as well post my solution - it’s a little slow (but not TLE, of course :)), but readable, I hope :slight_smile: CodeChef: Practical coding for everyone

Understood. Thanks a lot

Now that you pointed it out, I cant unsee it and its unnerving AF. Edited out, thanks!

2 Likes

Phew, that’s better - thanks!

Although I apparently earned “Regular” a couple of hours ago, so it turns out I could have done it myself XD

2 Likes

Damn, that’s really unnerving. Don’t know how i missed it first time. Thanks for edit @vijju123

2 Likes

showing TLE error in one of the subtask. what’s wrong?

https://www.codechef.com/viewsolution/26316696

hello, can you tell me what’s wrong with this solution?
showing TLE for the last case.

https://www.codechef.com/viewsolution/26325132

Congratulations! :smile:

1 Like

Hehe - thanks :slight_smile: I’ve already wielded my new, Almighty Power by fixing the spelling in this thread title XD : Very large array declaration

Soon no one on Earth will dare challenge me …

3 Likes