I think I found a loop hole in MAKETRI February Long Challenge 2017 question's test cases?

Consider the following code, which gets AC with 100 points for the question. The code can be found here:

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

Now, consider the following test case:

3 500 700
1 5 15

The intervals formed by the numbers are [5, 5] and [11,19]. Both these intervals are not present in the [L,R] range of [500,700]. Which implies that the answer for the above test case must be 0.

However, if you were to feed in that test case to the code solution in the link above, it gives 1. Which is wrong.

So, if that test case was included in the original contest, some submissions that got an AC would have got a WA.

Please correct me if I missed out on any constraints, etc and there isn’t a loop hole.

2 Likes

I mentioned this in last paragraph of the editorial, that the problem was missing a few corner cases. That’s why I edited the editorial to provide additional corner cases and asked people to run through them too. Disjoint interval concept were not properly tested. All test cases had overlapping intervals in range [L,R]. I think that they wanted to be lenient, since its not a category of test-case someone particularly misses. But of course, @errichto can perhaps help us and add test cases to practice problem I guess. :slight_smile:

2 Likes

@vijju123, oh nice! Yes I agree with you.

//