When are the results released?Like, any idea?
Please share the logic for the second one.
Can someone who has got 100pts in the first question share their logic.
For the second DP problem there are few basic observations.
-
We always put an integer because it will always increase the answer.
-
The answer can either be the maximum length of UpDown subsegment already present+1 ( put any integer at last in the subsegment) or it can be combination of 2 subsegments which are just separated by 1 element which doesnât obey the property. We can make the âbadâ element âgoodâ by inserting an integer beside it.
Let dp1[i] = maximum length of UpDown subsegment ending at index i
Let dp2[i] = maximum length of UpDown subsegment starting at index i
Now all that is left is to go through each index and find maximum value of dp1[i]+dp2[i] .
We can calculate DP and do this in O(n) with very small constant factor.
P.S. I may have missed some details and it is left as an exercise for the reader
Is there any 11th student here who is interested in making a WhatsApp group to prepare for next yearâs ZCO?
Any idea when the results are coming out?
The results are probably gonna be out by Monday i.e,10/12/2018(seeing from previous trends of announcing results ,that is) .
Btw ,did anyone properly notice the time limit for the questions? It was 2 seconds .Even a brute Force approach should have worked in c++ and other languages (Java - twice the time limit and python -4 times I guess),according to using just 10^7 ooperations per seconds .
The results have been probably declared. I received a mail from CodeChef, stating that all students with a score >= 40 have qualified for INOI 2019.
Cheers!
Arnav.
I was getting runtime error (SIGSEGV) for my brute force code for Singing Tournament, I donât know the reason behind it.
My code - https://ideone.com/Gb5ezB ,
Please Help.
Can somebody please properly explain the approach to solve SINGTOUR? Hereâs the part I understand: Sorting vectors of pairs (Upper limit, Index) and (Lower limit, Index).
What I do not understand is the logic behind iterating over i from 0 such that i\lt n and performing this operation at each iteration:
[second represents the index part of the pair]
score[lower_limits[i].second] += n - i - 1;
score[upper_limits[i].second] += i;
Can somebody please explain how this helps in computing the final score? Please note that this is with reference to the solution at https://www.codechef.com/viewsolution/22016797
@aryan_02:
It is based on the observation that, for an interval [l, r], each starting or ending point that lies inside this interval adds 1 to the score of this interval. So, if an interval lies completely inside, it has a starting point and an ending point lying inside [l, r] and hence it adds 2 to the score. For intersecting intervals, either the staring point or the ending point lies inside, and so each intersecting interval adds 1 to the score.
Also, all the intervals lying completely to the left of l or to the right of r add 1 to the score. This means, the score for [l,r] is equal to the number of starting points inside [l, r] (intersecting or lying completely inside) + the number of starting points after r (intervals lying to the right of r) + the number of ending points inside [l, r] (intersecting or lying completely inside) + the number of ending points before l (intervals lying to the left of l).
The first two terms and the last two terms above can be clubbed together which makes the score for [l, r] equal to the number of starting points after l (= n - i - 1, if index of l in lower_limits
is i) + the number of ending points before r (= j, if the index of r in upper_limits
is j).