By arsijo, 4 years ago,

Hi,

I am happy to announce that Lyft Level 5 Challenge 2018 — Final Round will be held in Palo Alto on Nov/04/2018 21:10 (Moscow time). The official round contains six problems and will last for two hours.

• First place: $2000 • Second place:$1000
• Third place: \$500

Here is the list of onsite finalists:

 tourist LHiC scott_wu ksun48 Marcin_smu matthew99 ecnerwala Kostroma RomaWhite Errichto ACRush *ikatanic ilyakor Arterm zxqfl desert97 Fdg neal KADR liympanda LiChenKoh ljecll waterfall liymbear xiaowuc1 azneyes chenmark balakrishnan *YerzhanU

If you are interested in an internship or a job at Lyft, follow the link below.

Interested in an internship or a job at Lyft?

If you are not participating in the Final Round, you will be able to take part in rated open divisions. Each of them contains six problems and will last for two and a half hours.

This round was prepared by _h_, Lewin, majk, Noam527, stanislav.bezkorovainyi, and me.

Thank you to 300iq, cdkrot, BigBag, danya.smelskiy, Fekete, MrDindows, Nazikk, Sonechko, winger, MaxZubec for help with testing.

Special thanks to KAN for helping me with coordinating, MikeMirzayanov for Polygon and Codeforces, and Lyft for organizing this competition.

Scoring distribution:

Div1 and onsite:

750-1250-1500-2000-2750-3000

Div2:

500-1000-1750-2250-2500-3000

We have onsite issues, the contest was postponed by at least 5 minutes.

Because of the onsite round, the system testing will be in an hour after the round.

Contest is over!

Congratulations to the winners!

Onsite competition:

 1 tourist 2 scott_wu 3 ecnerwala 4 RomaWhite 5 Errichto 6 ACRush 7 Arterm

Div 1:

 1 Radewoosh 2 mnbvmar 3 Benq 4 kiwikiwi 5 Reyna

Div 2:

 1 mrscherry 2 Kekmaster 3 brandonzhang 4 MAUZER 5 ---Grigor---

Editorial is available here.

Are you looking for photos from the onsite round? It is here.

• +302

 » 4 years ago, # |   +15 Is there going to be a livestream of the onsite finals?
•  » » 4 years ago, # ^ |   +3 Unfortunately no.
 » 4 years ago, # | ← Rev. 3 →   -31 :))
 » 4 years ago, # | ← Rev. 2 →   -27 Oh, very awkward time for China and Siberia.
 » 4 years ago, # | ← Rev. 4 →   +42 Hello, I have cancelled the onsite final due to unexpected time conflict. I have sent email to Lyft Level 5 staff who informed me about event logistics, but they have never replied me. Could you please remove me from the list and allow me to participate in the open mirror? lyftUpdate: they just replied me.
 » 4 years ago, # |   +61 Why is the official round shorter than the div1 round? Is it rated huh?
•  » » 4 years ago, # ^ |   +53 The first division will be easier because of this extra half of hour. And yes, all three rounds will be rated.
 » 4 years ago, # | ← Rev. 3 →   0 if comments on the codeforce is directly uploaded whether admin will be accepted then only upload it,,can u say anyone?
•  » » 4 years ago, # ^ |   +3 Mate, what do you want to say exactly? If you want to ask whether your comment is first verified by admins and then uploaded then it is not the case. If that would have been the case then some people wouldn't shit here anything they want.
 » 4 years ago, # |   +31 Regarding to random hoodies from the last round, which will be the score from which the seed is generated?The winner's score from onsite or some other score?
•  » » 4 years ago, # ^ |   +53 Good question!We are using the onsite round.
 » 4 years ago, # |   -46 Can someone explain how organizers are able to check if participants solve problems themselves, not with a team of helpers, which is quite important when people are struggling for financial prize.
•  » » 4 years ago, # ^ |   0 Because they're all there in person
•  » » 4 years ago, # ^ |   +11 It's an on-site round. Under the supervision of course.
 » 4 years ago, # |   0 Sometime Competition made me question my existence. :(
 » 4 years ago, # |   0 Any updates for the t-shirts of the elimination round?
•  » » 4 years ago, # ^ |   0 We will work on them starting next week.
 » 4 years ago, # |   -8 Ok, so there is now daylight savings time shift... so it's at 10 am PST now? Or still 11?
•  » » 4 years ago, # ^ |   +6 I don't think the countdown is affected by daylight savings.
 » 4 years ago, # |   -18 Please update the Scoring distribution...And one more ques , All the problems of this round will be interactive problem, won't it?
 » 4 years ago, # | ← Rev. 2 →   -14
 » 4 years ago, # | ← Rev. 2 →   -12 I am just waiting for tourist......... what he will do today......
 » 4 years ago, # |   +19 Why YerzhanU's handle with star?
•  » » 4 years ago, # ^ |   +94 I guess YerzhanU and ikatanic are no longer eligible since Lyft acquired our startup last week: https://techcrunch.com/2018/10/23/lyft-is-buying-london-ar-startup-blue-vision-labs-to-fuel-its-autonomous-car-efforts/
•  » » » 4 years ago, # ^ |   0 Yeah, I heard that news and was wondered what is a coincidence :)
 » 4 years ago, # |   +16 I think that today tourist will come back
•  » » 4 years ago, # ^ |   +93 Damn.
 » 4 years ago, # | ← Rev. 3 →   +21 Atleast 5 minutes :(
•  » » 4 years ago, # ^ |   +8 :(
 » 4 years ago, # |   0 Finally some questions with creativity shout out to lyft :)
 » 4 years ago, # |   0 What could be pretest 12 for Problem C? i kept getting WA !
•  » » 4 years ago, # ^ |   0 I think it is something like that: 3 10 2 4 6 2 2 1 1 1 3 2 2 5 1 2 6 1 2 7 3 4 2 3 4 4 5 6 1 5 6 3 5 6 5 Ans: 1 
 » 4 years ago, # |   +5 Oh God 10 more seconds please...
•  » » 4 years ago, # ^ |   0 Same here. I fixed a bug in my solution about 30 seconds before the end, but didn't get time to submit.
 » 4 years ago, # |   +1 how to solve Div2 C ?
•  » » 4 years ago, # ^ | ← Rev. 2 →   +3 Realise that you only need horizontal lines with that starts from 1. Sort horizontal lines and vertical lines, and then iterate trough verticals, and figure out if you don't use first i verticals, what is the answer. Output is minimal answer from all.
•  » » » 4 years ago, # ^ |   0 I was trying to solve it like that but Idk what I'm missingafter deleting all lines that starts with 1 and end with 1e9 and considering only the lines that start with 1 what's next ?I thought I need to see the longest horizental line and delete all vertical lines that blocks it but that was wrong ofcourse it's like dp or what how could we get the min
•  » » » » 4 years ago, # ^ |   0 Nothing that's it, maybe you just forgot about some condition, like me (wa on 12). But that is main idea.
•  » » 4 years ago, # ^ | ← Rev. 3 →   0 If you delete first A vertical lines (A+1'th is not deleted) then you have to delete horizontal lines too but only those such that x1=1 and x2>=x value of A+1'th vertical line
•  » » » 4 years ago, # ^ |   0 What if there are no Vertical lines?
•  » » » » 4 years ago, # ^ |   -7 Then just count the number of horizontal lines with x1=1 and x2=INF
•  » » » » » 4 years ago, # ^ |   0 Ok, Thank you.
 » 4 years ago, # |   +52 friendship ended with algorithms, ad-hoc is new best friend
 » 4 years ago, # |   +3 Is C can be solved with segment tree ?
•  » » 4 years ago, # ^ |   0 I tried using 2 segment tree but didn't manage to get AC , but i think it can be solved using segment tree .
•  » » » 4 years ago, # ^ |   0 Why 2? my idea is to add 1 to range [x1, x2] for horizontal spells and add 1 to range [x, 1e9] for vertical spells, then find the minimum, can any body confirm ?
•  » » » » 4 years ago, # ^ |   0 how do you find the minimum ?
•  » » » » » 4 years ago, # ^ |   0 Yeah, your right!
•  » » 4 years ago, # ^ |   +3 Yes, though not necessarily. Prefix sum is enough.
•  » » » 4 years ago, # ^ |   0 Can you please elaborate?
•  » » » » 4 years ago, # ^ | ← Rev. 3 →   +4 Let's denote f[i] as the number of horizontal lines that need to be removed, if we've removed i vertical lines beforehand. Obviously, the removed vertical lines have to be the leftmost ones.About the horizontal lines, it's certain that we will only remove such with leftmost x-coordinate equals to 1. Now we have to find out the maximum i (the number of removed vertical lines) such as that horizontal line still blocks our way — this can be done through binary search the rightmost x-coordinate of that line — let's denote the found value x.Then, all f(i) with 0 ≤ i ≤ x will be increased by 1.
 » 4 years ago, # |   +13 Isn't Timus 1003 same as div. 1 D?
•  » » 4 years ago, # ^ |   0 That one is somewhat easier, because there you can also do some sort of binary search. Div1D forces you to write an "augmented DSU". Though they are clearly similar.
•  » » » 4 years ago, # ^ |   +29 The problem is mine. I didn't intend to copy from any problem, and also none of the testers brought up any related problem. The problem is different, but I admit it can still help.Also, the problem is still solvable with merge small to big, so no need for augmented DSU (although I think it is simpler to code).
•  » » » » 4 years ago, # ^ |   0 Can you please provide the solution using small to big? During the contest I too tried with the same approach but could not find the bug in my implemented code till the end.
•  » » 4 years ago, # ^ |   +11 This is exactly the same question as in the IIT Kgp regionals for 2017/18. That was for a tree but the solution is exactly the same.
 » 4 years ago, # |   +3 I really liked C, it was a little bit hard to solve it but the idea is nice. Hard contest overall!
•  » » 4 years ago, # ^ |   0 So how did you solve it?
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +1 First sort the vertical lines by position and horizontal lines by size (x2 - x1 + 1), when taking the horizontal lines you just need the ones that start at 1, why? because if a horizontal line has x1 >= 2 you can always escape through 1. This is the trick of this problem. :) Now you will try to brute force, you will try to remove first vertical line and see if you can reach the top row of the chessboard, after this the second vertical line and so on. Each time you have to count the number of horizontal lines those size is larger or equal with v[i] (use binary search) and check if this is better than the current answer.by v[i] i mean the position of vertical line with index i after sorting.Hope you understood.
 » 4 years ago, # |   0 problem E is cool, I wish I'd submit it.
 » 4 years ago, # |   0 How to solve div2E(div1C)? I thought I could solve this problem :(
•  » » 4 years ago, # ^ | ← Rev. 2 →   +32 As an observation, there will always be k extreme points in a convex polygon (k ≤ 4), so every f(x) with x ≥ k will return the maximum answer.The solution for f(3) and convex polygon with 4 extreme points can be brute-forced. Simply traverse through all points, and with each point, match it with 2 out of 4 extreme points of the polygon.Total complexity is O(6 * n), can be reduced to O(n) by further geometrical observations.
•  » » » 4 years ago, # ^ |   +3 convex polygon with 4 extreme points wait what?I thought for n = 4 it was just the rectangle with side lengths of max x — min x, max y — min y?
•  » » » » 4 years ago, # ^ |   0 It's correct for f(4) and further.We still have f(3) left to calculate.
•  » » » » » 4 years ago, # ^ | ← Rev. 3 →   0 How to solve div2 B as i was using binary search and overall time complexity was O(mlogn)45304679 it was giving me tle
•  » » » » » » 4 years ago, # ^ |   0 The input seems quite large. Did you use fast I/O methods in your solution?
•  » » » » » » » 4 years ago, # ^ |   0 i just used scanf , printf afterwards but could not succeed.
•  » » » » » » » » 4 years ago, # ^ |   0 If I were you I'd go binary search as well. Without your solution (submission pages are inaccessible now), I cannot say for sure what you've done wrong.
•  » » » » » » » » » 4 years ago, # ^ |   0 actually my code was perfect but i was passing copy of array in function but when i changed that to reference it worked and i got fucked up
•  » » » » » » » 4 years ago, # ^ |   0 have you seen my code though
•  » » » 4 years ago, # ^ |   +5 Ohhh, I was confused about this for a while, but then I realized that the set of points had to be convex. That makes the problem a lot easier XP
•  » » » 4 years ago, # ^ | ← Rev. 3 →   +5 You need to consider at most 8 extreme points because there can exist two points with x = max xi, but it is preferable to choose only one of them, and the same holds for y.
•  » » » » 4 years ago, # ^ |   0 I think you can choose any one from each pair and get the same answer.
•  » » » » » 4 years ago, # ^ | ← Rev. 2 →   0 No, because if you choose triple "upmost, downmost and leftmost" points, then you care about x coordinate of both upmost and leftmost: the larger it is, the bigger is "Manhattan perimeter". So if you have pair of both upmost and downmost points, you must choose the rightmost of them
•  » » » » » » 4 years ago, # ^ |   0 I am only considering the case when we are calculating f(k) where k>=4. The difference in x-coordinate of the two upmost points will be compensated when we are going to take the manhattan distance with the rightmost point. For f(3) as AkiLotus mentioned, we will have to check all points with each pair from the 4 extreme points.
•  » » » » » » » 4 years ago, # ^ | ← Rev. 2 →   +5 Yes, and my point is that it is not enough to test all pairs out of 4 extreme points. Instead, we should consider pairs of 8 extreme points and test them all against N points.
•  » » » » » » » » 4 years ago, # ^ |   +8 Well, then I guess the problem has weak test cases. https://codeforces.com/contest/1075/submission/45296802
•  » » » » » » 4 years ago, # ^ | ← Rev. 2 →   +3 No, checking 4 points is enough because those other rightmost points will eventually be one of the n-4 alternative third points, and the rightmost of both on it's own is enough.
•  » » » » » » » 4 years ago, # ^ |   0 Not obvious, but I believe :)
•  » » » 4 years ago, # ^ | ← Rev. 4 →   0 Nice Explanation!
 » 4 years ago, # |   +8 Can someone explain how to solve Div1 A/Div2 C (The Tower is Going Home) problem?
•  » » 4 years ago, # ^ |   +1 If a horizontal wall doesn't start at 0, we can always go around it, so discard those. Also, y-coordinate of horizontal walls doesn't matter.Sort horizontal walls by their right end's x-coordinate, and vertical walls by their x-coordinate. Loop over how many horizontal walls we discard. Obviously the optimal ones to discard are always the one with maximal x-coordinate. Then, binary search how many vertical intervals we have to remove, so that we can reach the top row, when we have removed the given amount of horizontal intervals.
•  » » » 4 years ago, # ^ |   +8 Thank you!
 » 4 years ago, # |   0 How do we solve div1 D? I was thinking something like dynamic segment tree but I ended up with nothing.
•  » » 4 years ago, # ^ | ← Rev. 2 →   +24 When you know that xor on segment [l, r) is equal to x, you add edge between vertex l and r with cost x. Now to answer query [l, r) you need to find xor on the path between l and r (xor on costs of the edges). This can be done similar to LCA.
•  » » 4 years ago, # ^ |   +11 Consider the prefix xor-sum array p0, p1, ..., pn. Now the problem is basically giving you equations and asking for . Consider a graph on n + 1 nodes where u and v are connected by an edge of cost w iff . Then query is xor-sum of path from u to v. You can handle these with DSU (recompute distance from root for smaller tree when merging two trees).
•  » » » 4 years ago, # ^ |   0 Cooooooooooooooooool!
 » 4 years ago, # |   0 Someone Please Explain how to solve Div2C ?
 » 4 years ago, # |   +3 Take all the vertical lines and sort them in increasing order.Now suppose you are considering a vertical line i,then you have to remove i-1 vertical lines + horizontal lines starting from 1 and ending at some position greater then i.This way,you can select minimum lines to delete. Corner cases can be handled separately.
•  » » 4 years ago, # ^ |   0 What are the corner cases ? My approach is same. But got WA on test 6.
 » 4 years ago, # | ← Rev. 3 →   +2 Is this solution for D?Ask "B y1" and answer for this is p 1) If p exist in first set then we are done2) Else, find closest node to p such that it belongs to first set. Call it q. Ask for "A q" and answer for this is T. If T exist in second test then solution is q else there are no common nodes.
•  » » 4 years ago, # ^ |   0 That was my solution and it passed pretests.
•  » » » 4 years ago, # ^ |   -7 Duuuuude that's not fair, literally needed 5 more seconds
•  » » 4 years ago, # ^ |   +1 Yes that is correct.
•  » » 4 years ago, # ^ |   0 When you're trying to submit this for more than an hour but you get 13 WAs instead of an AC :(
•  » » » 4 years ago, # ^ |   +1 When you open submit page and it says contest ended
•  » » 4 years ago, # ^ |   0 What if multiple closest nodes to p?
•  » » » 4 years ago, # ^ |   +4 It's not possible, think about it ;)
•  » » » » 4 years ago, # ^ |   0 Yea, correct.
 » 4 years ago, # |   +29 Very well explained problems. Even though some of the problems were long and complicated, the statements were quite clear and the sample test cases did the rest. Kudos to the problem setters!
 » 4 years ago, # | ← Rev. 2 →   0 How to solve div2 B as i was using binary search and overall time complexity was O(mlogn)45299906 it was giving me tle
•  » » 4 years ago, # ^ |   0 Just find the immediate left and immediate right driver for each rider. You can do this by first scanning the array from left to right to find the immediate left driver for each rider. Then scan the array from right to left to find the immediate right driver for each rider. While doing so, maintain the distance as well as the position of the driver. Now for each rider, compare the left and the right distance, whichever is shorter, increase the count for that driver's position.
 » 4 years ago, # | ← Rev. 2 →   +18 I solve C but can't solve B... too sad. maximum question=5, n=1000, so I try to think about O(lgn/2) solution lol
•  » » 4 years ago, # ^ |   0 I think this is correct solution http://codeforces.com/blog/entry/62929?#comment-469374
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 It can be done in at most two queries:We are given at least one node X that is in Li's subtree (with his labeling). We ask B X. If the given label is one of our chosen vertexes, great. Otherwise, we are given node Z (in our labeling).We find the closest node to Z that is in our chosen subtree. Let's call it Y. Now suppose there is a node X in the intersection of the two subtrees. Since node Y is on the path between X and Z, then it must be in Li's subtree aswell, so Y must be a common vertex if an intersection exists. So we just ask A Y: if the given label is one of y1, y2, ..., yk2then Y is in the intersection. Otherwise output -1
 » 4 years ago, # |   0 Div 2 C ? is this related to disjoint union? or else whats the best solution?
•  » » 4 years ago, # ^ |   0 Look at this : http://codeforces.com/blog/entry/62929?#comment-469369
•  » » 4 years ago, # ^ | ← Rev. 2 →   0 Solution is very very simple...much simplier than it seems get verticals numbers array and sort them, then add n to the end get horizontals array... we need only parameter x2, and only spells where x1 = 1, because rest are useless, also ignore parameter y, it is useless at all, no matter which value is in it, hahaha...Then sort horizontals for each vertical x count removings as index in array + horizontals values which more or equal to vertical value and find minimum Thats it =)Problem seems much more complicated than it realy is
 » 4 years ago, # |   +19 Not sure if I should sleep or wait for systests
•  » » 4 years ago, # ^ |   0 Exactly...!! Lol..
 » 4 years ago, # |   -13 ObservationForces!!
•  » » 4 years ago, # ^ |   +57 What would be your ideal problem set then?The way I see it, to solve any nontrivial problem you need to make several observations. What is the alternative? Implement well-known but difficult algorithms? Because in my opinion the former is vastly superior to the latter.
•  » » » 4 years ago, # ^ |   0 Exactly! If the problems do not require new and different observations, one that knows the required algorithms will just be in a typing competition (if one don't just copy and paste codes).
•  » » » 4 years ago, # ^ | ← Rev. 2 →   +57 Why did you think that was a negative comment? It's not like I wrote 'SpeedForces' or 'ImplementationForces'. I have huge respect for problem setters who can make tough problems that don't require complex algorithms or data structures.
 » 4 years ago, # |   0 Why is there such a long delay for system tests too start? Should I just go to sleep?
•  » » 4 years ago, # ^ |   +5 Because of the onsite round, the system testing will be in an hour after the round.It's already over anyway.
 » 4 years ago, # |   0 Who won the onsite finals????
•  » » 4 years ago, # ^ |   +6 Guess who =)
•  » » » 4 years ago, # ^ |   -6
•  » » 4 years ago, # ^ |   0
 » 4 years ago, # |   +11 Great Problem Set!!! Kudos to the authors!!!!!!!
 » 4 years ago, # |   0 Div2 C. Why my solution failed on test no. 17 I used Difference array and Binary search.? http://codeforces.com/contest/1075/submission/45302142
•  » » 4 years ago, # ^ |   +10 There are written "wrong answer", answer should be 17444, yours is differ
•  » » 4 years ago, # ^ |   0 What was the thing that you were missing? I have same approch and getting WA on test case 17.
•  » » » 4 years ago, # ^ |   0 Because we calculated answer for all the horizontal lines.only horizontal lines starting with 1 should be taken. Link to Accepted solution with same approach http://codeforces.com/contest/1075/submission/45376580
•  » » » » 4 years ago, # ^ |   +1 Got it thanks.
 » 4 years ago, # |   0 Div2-C is so funny — seems like something complex and then you realize that solution is so simple, that half of data even can be skipped like parametre y in horizontal spells... Unfortunately i realized it after contest was finished...
 » 4 years ago, # |   +5 Two Div.2 problems were about chess. That reminded me that World Chess Championship will start in a few days :)
 » 4 years ago, # |   0 Getting MLE in DIV-2(D) . submission — 45317188 . Why?
•  » » 4 years ago, # ^ |   +1 The judge responded with -1 and you didnt terminate your program so you got any verdict.
•  » » » 4 years ago, # ^ |   0 Thanks for your reply.I've checked it 45319433 . If my tracing is correct, the judge didn't reply with -1.
•  » » 4 years ago, # ^ |   +11 Possibly your BFS loops infinitely, you don't really check whether you're not visiting your parent again.
•  » » » 4 years ago, # ^ |   0 Thanks. accepted!! :)
•  » » » » 4 years ago, # ^ |   +4 Hurray :-)
 » 4 years ago, # | ← Rev. 2 →   +1 how this test Output (0) ?? not (1) 4 6 3 6 9 12 1 2 2 2 3 2 2 3 4 3 1000000000 2 3 1000000000 3 3 1000000000 4 arsijo
 » 4 years ago, # |   0 For DIV2 C.Is this a valid input?1 241 2 23 4 2 If yes, then answer should be 1?
•  » » 4 years ago, # ^ |   0 No, this is not valid.According to the problem statement "The peculiarity of these spells is that it is impossible for a certain pair of such spells to have a common point". In that testcase, there is one common point (2, 2). Therefore, it is not valid.
 » 4 years ago, # | ← Rev. 4 →   0 Can anyone tell me WA on test 11 45992429 1075C - The Tower is Going Home ?UPDATE ACCEPTEDthe wrong was that i wasn't sorting vertical lines