Invitation to RECode 15.0

Greetings CodeChef Community

RECursion, the Coding Community of NIT Durgapur is glad to invite you to RECode 15.0 which will be held on 16th December at 21:30 IST.

There will be 5 problems for both the divisions and 2 hours to solve them.

We present our special thanks to CodeChef for helping us to prepare the contest and for such an amazing platform.


  • Overall Best Performer will receive a cash prize of Rs. 3000

  • Best Performer from NIT Durgapur will receive a cash prize of Rs. 2000

  • Best Performer from NIT Durgapur (Freshman) will receive exciting goodies.

  • All top performers will receive certificates.

So buckle up and don’t miss out on this wonderful opportunity to test yourself. See you soon on the leaderboard.

Happy Coding😄



Won’t this be rated?

not rated

problems from your contests are always impressive and something from which I can learn. Thank you for organizing the contest in such hard times and hoping for the same experience as previous


Friendly reminder that the contest will start in 20 mins.

Good luck to all participants!

1 Like

is this rated?

No, it’s an unrated contest.

okk thanks will participate

can anyone see why this is giving TLE for PROBLEM speed ?

Can someone give me a test-case for which my solution fails ?

Can anyone tell me the case where my code fails.
i have checked all the cases it is working fine but still i got wa.

@rkr_725, please give a test case for REC15C where my code is failing. I have tried many cases with solutions but all are coming out to be correct.
Here is my submission:

You didn’t read the question properly. All the values were distinct.

ohh,Yes u r right,It’s my mistake :sweat_smile:

It’s wrong for large test cases. For example the correct output for 998005893107997600 is 3400.

consider this test case

1 0 8
1 3 4
4 3 4
1 5 6
1 1 2
3 5 6
7 3 5
1 0 8
7 3 6
8 1 6
1 6 7
6 1 5

your code is giving
but the original output is

once run only second test case with your code it is also giving 43
(may be you missed to reinitialize something)

Consider the test case 998005893107997600 for which the correct output is 3400.

Never use sqrt() when N \leq 10^{18}. Instead use a binary search for finding that ‘ss’. Your logic is correct otherwise.

ok , thanks.

Got the error, it was re-initialization of the tree. Thanks.