July 2019 Lunchtime Discussion

Kaha Aya. Kuch submit he nhi kiya :sweat_smile::joy:

I also knew but I wanted to solve all 3 so I got all anxious due to less practice of short contests…if there were 6-7 hours I would be very comfortable. :slight_smile:

if you are talking about the kickstart then can you share your idea on how to solve 2nd problem?

I solved all problems partially.
But,
Yup, I have solved 2 and a half problems after the contest.
For 2nd problem…I create a pile of discs and keep checking. Finally, I get the correct answer.
For the last one, I’ve reached the solution for it if abs() is not involved…will take more 1 hiur to crack it.
I did see you in the contest but forgot your rank :slight_smile:

HOW TO SOLVE THE QUESTION TWO LANES??

greedy works
make freq of contiguous obstacles in same lane <=2
Meaning if lanes are 1 1 1 2 2 2 2 1 2 1 2
Then make it 1 1 2 2 1 2 1 2 by keeping first and last obstacle of each type. Meaning we remove 2nd , 5th and 6th obstacle as they are extra.
Now it’s greedy. Think a bit more and you should get solution. Ping me if you don’t get it. I will give more hints.

1 Like

I was stuck on one particular thought yesterday … What if the obstacles are 1 2 1 and we are currently on 1st obstacle… Now let’s say that 2nd and 3rd obstacle didn’t have distance of d , so we will have to change our lane before we encounter obstacle 1 so that we are able to change at 2 … How does it deals with this situation?

I didn’t get your question but I will explain you the core logic.


   |p              |             :
        |      |        |        :

See now if he is a position p then he will switch lane at position \max(p+d,pos_3)
Now if \max(p+d,pos_3) \geq pos_4 (meaning if there is an obstacle in b/w then it’s not possible to move ahead.
Then it’s impossible.
If not then switch to the other lane and apply same logic again.
As soon as you switch lane apply - \max(p+d,pos_of_obstacle on the lane you want to switch to)
As I said just remove extra obstacles before applying above logic and keep
1 1 2 2 1 2 1 2 from 1 1 1 2 2 2 2 1 2 1 2
By removing obstacle at position 2,5,6.
Here is my AC solution applying above logic.
Also my code removes all obstacles which are after two obstacle in different lanes having difference of position=1 as we can’t go further.

1 Like

for(i=1;i<n;i++)
if(x[i-1].second+1==x[i].first){
k=x[i].first;
break;
}

is this piece really necessary … doesnt the second loop take care of this condition??

Why don’t they just understand us for not having supper, sitting for three hours for such strange time 7 : 30 to 10 : 30 and then just realizing that the contest went unrated?

1 Like

Its really bad that the editorials aren’t released yet. Its actually very frustrating. Can I just know when will they release the editorials or have you dropped the idea of posting the editorials ?
PS : I want to tag the admin/setter if I have to.

theyre out

1 Like

Hey @ankur314 where can I find kickstart problem analysis?

It is present right there on the problem page. You will have a tab of analysis in the problem page. They have not updated it yet maybe.

Maybe Not necessary. I didn’t know before cuz I wrote next loop after writing this loop :stuck_out_tongue:

1 Like

Yeah I always don’t have supper for these contests cuz timing of contest clashes with my supper.
And after that I was really happy with other questions being nice and my rank was 35. I was happy and suddenly after contest was over they say it’s unrated. :frowning:

Ohh :smile: Thanks alot though!

1 Like

You’re welcome :smile:

:cry:, parantu next time div 2 unrated hoga. God sirf div1 unrated nahi karta. :rofl::rofl:

1 Like

Dekhte hai wo to.
Muje to Lagta hai k ye Anyay div1 k sath hoga ya fir dono division k liye :stuck_out_tongue:
Easy que me mistake k chances Kam hai.

1 Like