You are not logged in. Please login at to post your questions!


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:

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.

asked 17 Mar '17, 11:11

mukund_a's gravatar image

accept rate: 0%

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. :)


answered 17 Mar '17, 11:16

vijju123's gravatar image

5★vijju123 ♦♦
accept rate: 18%

edited 17 Mar '17, 11:18

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

(17 Mar '17, 12:06) mukund_a3★
toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 17 Mar '17, 11:11

question was seen: 441 times

last updated: 17 Mar '17, 12:06