Автор arsijo, 5 лет назад, По-английски

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.

Winners will receive:

  • 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 fmqjpt 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.

If you have never solved interactive problems before, please read this.

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 DearMargaret
5 Reyna

Div 2:

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

Editorial is available here.

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

  • Проголосовать: нравится
  • +302
  • Проголосовать: не нравится

»
5 лет назад, # |
  Проголосовать: нравится +15 Проголосовать: не нравится

Is there going to be a livestream of the onsite finals?

»
5 лет назад, # |
Rev. 3   Проголосовать: нравится -31 Проголосовать: не нравится

:))

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится -27 Проголосовать: не нравится

Oh, very awkward time for China and Siberia.

»
5 лет назад, # |
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? lyft

Update: they just replied me.

»
5 лет назад, # |
  Проголосовать: нравится +61 Проголосовать: не нравится

Why is the official round shorter than the div1 round? Is it rated huh?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +53 Проголосовать: не нравится

    The first division will be easier because of this extra half of hour. And yes, all three rounds will be rated.

»
5 лет назад, # |
Rev. 3   Проголосовать: нравится 0 Проголосовать: не нравится

if comments on the codeforce is directly uploaded whether admin will be accepted then only upload it,,can u say anyone?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +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.

»
5 лет назад, # |
  Проголосовать: нравится +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?

»
5 лет назад, # |
  Проголосовать: нравится -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.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Any updates for the t-shirts of the elimination round?

»
5 лет назад, # |
  Проголосовать: нравится -8 Проголосовать: не нравится

Ok, so there is now daylight savings time shift... so it's at 10 am PST now? Or still 11?

»
5 лет назад, # |
Rev. 2   Проголосовать: нравится -14 Проголосовать: не нравится


»
5 лет назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

Why YerzhanU's handle with star?

»
5 лет назад, # |
  Проголосовать: нравится +16 Проголосовать: не нравится

I think that today tourist will come back

»
5 лет назад, # |
Rev. 3   Проголосовать: нравится +21 Проголосовать: не нравится

Atleast 5 minutes :(

»
5 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

Почему когда я, после начале контеста, нажал по ссылке в появляющемся окне меня перекинуло сюда: https://codeforces.com/gym/101021/problem/A , а не на сам контест? Кек. И я решил эту задачу, и только потом понял что это совсем другая задача. Контест после этого не стал решать, прошло уже больше 10 минут. Как так получилось?

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Finally some questions with creativity shout out to lyft :)

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

What could be pretest 12 for Problem C? i kept getting WA !

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 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
    
»
5 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Oh God 10 more seconds please...

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    Same here. I fixed a bug in my solution about 30 seconds before the end, but didn't get time to submit.

»
5 лет назад, # |
  Проголосовать: нравится +1 Проголосовать: не нравится

how to solve Div2 C ?

  • »
    »
    5 лет назад, # ^ |
    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.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      I was trying to solve it like that but Idk what I'm missing

      after 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

      • »
        »
        »
        »
        5 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        Nothing that's it, maybe you just forgot about some condition, like me (wa on 12). But that is main idea.

  • »
    »
    5 лет назад, # ^ |
    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

»
5 лет назад, # |
  Проголосовать: нравится +52 Проголосовать: не нравится

friendship ended with algorithms, ad-hoc is new best friend

»
5 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

Is C can be solved with segment tree ?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    I tried using 2 segment tree but didn't manage to get AC , but i think it can be solved using segment tree .

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +3 Проголосовать: не нравится

    Yes, though not necessarily. Prefix sum is enough.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 0 Проголосовать: не нравится

      Can you please elaborate?

      • »
        »
        »
        »
        5 лет назад, # ^ |
        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.

»
5 лет назад, # |
  Проголосовать: нравится +13 Проголосовать: не нравится

Isn't Timus 1003 same as div. 1 D?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 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.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +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).

      • »
        »
        »
        »
        5 лет назад, # ^ |
          Проголосовать: нравится 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.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +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.

»
5 лет назад, # |
  Проголосовать: нравится +3 Проголосовать: не нравится

I really liked C, it was a little bit hard to solve it but the idea is nice. Hard contest overall!

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится

    So how did you solve it?

    • »
      »
      »
      5 лет назад, # ^ |
      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.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

problem E is cool, I wish I'd submit it.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How to solve div2E(div1C)? I thought I could solve this problem :(

  • »
    »
    5 лет назад, # ^ |
    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.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +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?

      • »
        »
        »
        »
        5 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        It's correct for f(4) and further.

        We still have f(3) left to calculate.

        • »
          »
          »
          »
          »
          5 лет назад, # ^ |
          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

          • »
            »
            »
            »
            »
            »
            5 лет назад, # ^ |
              Проголосовать: нравится 0 Проголосовать: не нравится

            The input seems quite large. Did you use fast I/O methods in your solution?

            • »
              »
              »
              »
              »
              »
              »
              5 лет назад, # ^ |
                Проголосовать: нравится 0 Проголосовать: не нравится

              i just used scanf , printf afterwards but could not succeed.

              • »
                »
                »
                »
                »
                »
                »
                »
                5 лет назад, # ^ |
                  Проголосовать: нравится 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.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится +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

    • »
      »
      »
      5 лет назад, # ^ |
      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.

      • »
        »
        »
        »
        5 лет назад, # ^ |
          Проголосовать: нравится 0 Проголосовать: не нравится

        I think you can choose any one from each pair and get the same answer.

        • »
          »
          »
          »
          »
          5 лет назад, # ^ |
          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

          • »
            »
            »
            »
            »
            »
            5 лет назад, # ^ |
              Проголосовать: нравится 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.

          • »
            »
            »
            »
            »
            »
            5 лет назад, # ^ |
            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.

    • »
      »
      »
      5 лет назад, # ^ |
      Rev. 4   Проголосовать: нравится 0 Проголосовать: не нравится

      Nice Explanation!

»
5 лет назад, # |
  Проголосовать: нравится +8 Проголосовать: не нравится

Can someone explain how to solve Div1 A/Div2 C (The Tower is Going Home) problem?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +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.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

How do we solve div1 D? I was thinking something like dynamic segment tree but I ended up with nothing.

  • »
    »
    5 лет назад, # ^ |
    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.

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +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).

»
5 лет назад, # |
  Проголосовать: нравится +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.

»
5 лет назад, # |
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 done
2) 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.

»
5 лет назад, # |
  Проголосовать: нравится +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!

»
5 лет назад, # |
  Проголосовать: нравится +26 Проголосовать: не нравится

Can admin allow access to submission pages? Thanks

»
5 лет назад, # |
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

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 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.

»
5 лет назад, # |
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

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 0 Проголосовать: не нравится
  • »
    »
    5 лет назад, # ^ |
    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, ..., yk2

    then Y is in the intersection. Otherwise output -1

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Div 2 C ? is this related to disjoint union? or else whats the best solution?

»
5 лет назад, # |
  Проголосовать: нравится +19 Проголосовать: не нравится

Not sure if I should sleep or wait for systests

»
5 лет назад, # |
  Проголосовать: нравится -13 Проголосовать: не нравится

ObservationForces!!

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +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.

    • »
      »
      »
      5 лет назад, # ^ |
        Проголосовать: нравится 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).

    • »
      »
      »
      5 лет назад, # ^ |
      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.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Why is there such a long delay for system tests too start? Should I just go to sleep?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится +5 Проголосовать: не нравится

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

    It's already over anyway.

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Who won the onsite finals????

»
5 лет назад, # |
  Проголосовать: нравится +11 Проголосовать: не нравится

Great Problem Set!!! Kudos to the authors!!!!!!!

»
5 лет назад, # |
  Проголосовать: нравится 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

»
5 лет назад, # |
  Проголосовать: нравится +5 Проголосовать: не нравится

Two Div.2 problems were about chess. That reminded me that World Chess Championship will start in a few days :)

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

Getting MLE in DIV-2(D) . submission — 45317188 . Why?

»
5 лет назад, # |
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

»
5 лет назад, # |
  Проголосовать: нравится 0 Проголосовать: не нравится

For DIV2 C.
Is this a valid input?
1 2
4
1 2 2
3 4 2

If yes, then answer should be 1?

  • »
    »
    5 лет назад, # ^ |
      Проголосовать: нравится 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.