Invitation to RECode 15.0

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

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

your code is giving
22
45
but the original output is
22
43

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.

Please add the problems to practice section.

Will there be editorials for these question?

what was the logic for the problem “Speed”, can someone help me?

1 Like

Why?

I got it I missed a pq.empty() condition but the checker should show RE and it showed TLE

find maximum speed for all possible consecutive intervals from 0 to T
ans is sum of length of interval*maximum speed

1 Like

Yes, we will be posting the editorials soon.

1 Like

There can be floating point errors with large values. Although there are functions like sqrtl() for handling that but I prefer to do calculations using integers.

1 Like

Can anyone explain for the first question(EQUAL)
ans for this test case
4
2 4 4 4
shouldn’t it be 2 ?
but the o/p is 4 why ?

1 Like

This is an invalid test case. The readings need to be unique .

1 Like

Please read the problem carefully. It was boldly mentioned the readings are unique. The final value that needs to be equal(equal value), may or may not belong to the array.

2 Likes

Sorry, yes, you are right.

Okay, but someone to inbox me, I wanna ask something