1 / 3
Sep 2022

I am trying to understand problem statement of https://www.spoj.com/problems/INTDSET/18
but the statement itself is not clear.
How is the answer for the first test case one when there is no overlap at all ?

Many users have expressed doubts in comments. I guess the original problem setter is no longer active which is why no one is replying to the comments.

PS: Please dont give any hints or suggestions of solution.
I just need clarification on the problem statement and nothing more.

  • created

    Sep '22
  • last reply

    Sep '22
  • 2

    replies

  • 697

    views

  • 2

    users

  • 1

    link

For a subset S equal to A, the condition is vacuously true, since there are no intervals left which are not in S.

I kind of get what you are trying to say.

S={(1,2),(3,4),(5,6)}
A={(1,2),(3,4),(5,6)}
S-A={}
for every element in S-A is there should be an overlapping element in S.
Since there is no element in S-A, so for null element there is an overlapping element ?
But my question is shouldn’t that overlapping element be (-∞,+∞) or are you assuming S has a null element which operlaps with that null ?

Essentily for this weird case that you are talking about w should always add one to the practicl answer.
For the second test case also I can see 6 cases but output is 7. So your assumption holds there.