Quantcast
Channel: CodeChef Discuss - latest questions
Viewing all articles
Browse latest Browse all 40121

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

$
0
0

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.


Viewing all articles
Browse latest Browse all 40121

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>