I’m referring to the problem Time to Study Graphs with Chef in February Long Challenge 2015

In this problem the constraints on the subtask #2 are:
n, m <= 110, k <= 30 (30 points)

However, I suspect the constraints on k are not followed in the Task #16 , which is part of the subtask #2

See these two solutions made by me:

Solution with 20 points

Solution with 50 points

The only difference between the two solutions is in the line 7. 1st solution uses array of size 30 to store the edges, whereas in 2nd solution the array size is 300.
Apart from this both solutions are identical.

Yet the 1st solution gave SIGSEGV on task #16 and has 20 points.
Whereas the 2nd solution has AC for task #16 and has got 50 points.

Can admin please explain this?

Hello, It’s better to use assert() statements to check the constraints, rather than just increasing the array size. If possible, try to do that.

Best,

Chaitanya.

1 Like

dambero
February 20, 2015, 7:21pm
3
Yes I agree. The constraints are wrong for task #16 .
See what I did to verify this: Solution

Value of K violating constraints is K=66

1 Like

Thanks for the efforts.
It took me around 40 submissions in 1 hour to figure out the cause of that SIGSEGV

See My Solutions to this problem

But, my point here is that isn’t it unfair to have test data not conforming to the specified constraints?

Thanks for the reply Bur my point is that isn’t it unfair to have test data which does not follow constraints?