Lyft Level 5 Challenge 2018 - Final Round

Solutions are presented as using the least memory and the fastest execution time. It also takes the top 10 most recent solutions from each language. If you want to limit to a specific index, click the "Solved" button and go to that problem.

ContestId
Name
Phase
Frozen
Duration (Seconds)
Relative Time
Start Time
1044 Lyft Level 5 Challenge 2018 - Final Round FINISHED False 7200 196170623 Nov. 4, 2018, 6:10 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 591 ) F DFS PROGRAMMING data structures 2600

B'Let T be a tree on n vertices. Consider a graph G_0 , initially equal to T . You are given a sequence of q updates, where the i -th update is given as a pair of two distinct integers u_i and v_i . For every i from 1 to q , we define the graph G_i as follows: Formally, G_i := G_{i-1} triangle { {u_i, v_i } } where triangle denotes the set symmetric difference. Furthermore, it is guaranteed that T is always a subgraph of G_i . In other words, an update never removes an edge of T . Consider a connected graph H and run a depth-first search on it. One can see that the tree edges (i.e. the edges leading to a not yet visited vertex at the time of traversal) form a spanning tree of the graph H . This spanning tree is not generally fixed for a particular graph -- it depends on the starting vertex, and on the order in which the neighbors of each vertex are traversed. We call vertex w good if one can order the neighbors of each vertex in such a way that the depth-first search started from w produces T as the spanning tree. For every i from 1 to q , find and report the number of good vertices. The first line contains two integers n and q ( 3 <= n <= 2 cdot 10^5 , 1 <= q <= 2 cdot 10^5 ) -- the number of nodes and the number of updates, respectively. Each of the next n-1 lines contains two integers u and v ( 1 <= u, v <= n , u ne v ) -- vertices connected by an edge in T . It is guaranteed that this graph is a tree. Each of the next q lines contains two integers u and v ( 1 <= u, v <= n , u ne v ) -- the endpoints of the edge that is added or removed. It is guaranteed that this edge does not belong to T . For each update, print one integer k -- the number of good vertices w after the corresponding update. Th'...

Tutorials

Lyft Level 5 Challenge 2018 — Final Round — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
46529016 Dust1404 F Dec. 3, 2018, 2:48 a.m. OK GNU C++11 TESTS 68 514 33996800 2600
56505453 Dilute F July 4, 2019, 8:16 a.m. OK GNU C++11 TESTS 68 514 76492800 2600
56505493 Dilute F July 4, 2019, 8:17 a.m. OK GNU C++11 TESTS 68 530 76492800 2600
51922119 luogu_bot5 F March 28, 2019, 5:19 a.m. OK GNU C++11 TESTS 68 545 44032000 2600
47003669 luogu_bot3 F Dec. 14, 2018, 12:53 p.m. OK GNU C++11 TESTS 68 592 78131200 2600
47003924 luogu_bot4 F Dec. 14, 2018, 1:01 p.m. OK GNU C++11 TESTS 68 607 78131200 2600
47003719 luogu_bot1 F Dec. 14, 2018, 12:56 p.m. OK GNU C++11 TESTS 68 608 78131200 2600
47003685 luogu_bot3 F Dec. 14, 2018, 12:54 p.m. OK GNU C++11 TESTS 68 608 78131200 2600
47003959 luogu_bot1 F Dec. 14, 2018, 1:02 p.m. OK GNU C++11 TESTS 68 623 78131200 2600
48327969 daifucong F Jan. 13, 2019, 12:51 p.m. OK GNU C++11 TESTS 68 639 67072000 2600
46959449 neal F Dec. 13, 2018, 7:05 a.m. OK GNU C++14 TESTS 68 576 31744000 2600
47506796 neal F Dec. 26, 2018, 1:35 a.m. OK GNU C++14 TESTS 68 577 31744000 2600
45686118 neal F Nov. 13, 2018, 6:23 p.m. OK GNU C++14 TESTS 68 607 32563200 2600
45686290 neal F Nov. 13, 2018, 6:30 p.m. OK GNU C++14 TESTS 68 607 32768000 2600
45943690 neal F Nov. 18, 2018, 9:12 p.m. OK GNU C++14 TESTS 68 608 32768000 2600
45334863 neal F Nov. 5, 2018, 5:07 p.m. OK GNU C++14 TESTS 68 623 32563200 2600
45310723 neal F Nov. 5, 2018, 3:41 a.m. OK GNU C++14 TESTS 68 685 32768000 2600
45316971 tmwilliamlin168 F Nov. 5, 2018, 8:34 a.m. OK GNU C++14 TESTS 68 733 34201600 2600
45297356 ecnerwala F Nov. 4, 2018, 7:15 p.m. OK GNU C++14 TESTS 68 764 57958400 2600
62679815 NotNight F Oct. 16, 2019, 12:31 p.m. OK GNU C++14 TESTS 68 826 48128000 2600
63611404 neal F Oct. 27, 2019, 5:24 p.m. OK GNU C++17 TESTS 68 592 31744000 2600
51101745 neal F March 9, 2019, 7:21 p.m. OK GNU C++17 TESTS 68 608 31744000 2600
51926045 neal F March 28, 2019, 7:44 a.m. OK GNU C++17 TESTS 68 623 31744000 2600
51101699 neal F March 9, 2019, 7:20 p.m. OK GNU C++17 TESTS 68 623 31744000 2600
51101655 neal F March 9, 2019, 7:18 p.m. OK GNU C++17 TESTS 68 639 31744000 2600
60324049 AliShahali1382 F Sept. 9, 2019, 10:58 p.m. OK GNU C++17 TESTS 68 654 44851200 2600
45306780 LHiC F Nov. 4, 2018, 10:26 p.m. OK GNU C++17 TESTS 68 686 45158400 2600
60323439 AliShahali1382 F Sept. 9, 2019, 10:15 p.m. OK GNU C++17 TESTS 68 716 61644800 2600
67940520 xiaowuc1 F Dec. 30, 2019, 12:14 a.m. OK GNU C++17 TESTS 68 732 33996800 2600
45306430 Marcin_smu F Nov. 4, 2018, 10:12 p.m. OK GNU C++17 TESTS 68 811 44544000 2600
68696606 dalt F Jan. 13, 2020, 8:08 a.m. OK Java 8 TESTS 68 1231 220569600 2600
45301767 qwerty787788 F Nov. 4, 2018, 8:04 p.m. OK Java 8 TESTS 68 1279 76492800 2600
45301564 ilyakor F Nov. 4, 2018, 8:02 p.m. OK Java 8 TESTS 68 1325 156979200 2600
45301146 Petr F Nov. 4, 2018, 7:57 p.m. OK Java 8 TESTS 68 1949 199782400 2600

remove filters

Back to search problems