Codeforces Round 505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final)

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
1025 Codeforces Round 505 (rated, Div. 1 + Div. 2, based on VK Cup 2018 Final) FINISHED False 8100 197137499 Aug. 19, 2018, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 733 ) G Company Acquisitions PROGRAMMING constructive algorithms math 3100

B"There are n startups. Startups can be active or acquired. If a startup is acquired, then that means it has exactly one active startup that it is following. An active startup can have arbitrarily many acquired startups that are following it. An active startup cannot follow any other startup. The following steps happen until there is exactly one active startup. The following sequence of steps takes exactly 1 day. For example, the following scenario can happen: Let's say A , B are active startups. C , D , E are acquired startups under A , and F , G are acquired startups under B : Active startups are shown in red. If A acquires B , then the state will be A , F , G are active startups. C , D , E , B are acquired startups under A . F and G have no acquired startups: If instead, B acquires A , then the state will be B , C , D , E are active startups. F , G , A are acquired startups under B . C , D , E have no acquired startups: You are given the initial state of the startups. For each startup, you are told if it is either acquired or active. If it is acquired, you are also given the index of the active startup that it is following. You're now wondering, what is the expected number of days needed for this process to finish with exactly one active startup at the end. It can be shown the expected number of days can be written as a rational number P/Q , where P and Q are co-prime integers, and Q not= 0 pmod{10^9+7} . Return the value of P cdot Q^{-1} modulo 10^9+7 . The first line contains a single integer n ( 2 <= q n <= q 500 ), the number of startups. The next line will contain n space-separated integers a_1, a_2, ldots, a_n ( a_i = -1 or 1 <= q a_i <= q n ). If a_i = -1 , then that means startup i i"...

Tutorials

Codeforces Round #505 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41922993 Panole233 G Aug. 21, 2018, 5:50 a.m. OK GNU C++ TESTS 36 15 0 3100
42122355 luogu_bot3 G Aug. 26, 2018, 1:09 p.m. OK GNU C++ TESTS 36 30 0 3100
42014011 rainy_season G Aug. 24, 2018, 4:50 a.m. OK GNU C++ TESTS 36 30 0 3100
41990859 616156 G Aug. 23, 2018, 8:45 a.m. OK GNU C++ TESTS 36 31 0 3100
41937012 samjia2000 G Aug. 21, 2018, 1:32 p.m. OK GNU C++ TESTS 36 31 0 3100
42013471 themaxmaxmax G Aug. 24, 2018, 4:06 a.m. OK GNU C++11 TESTS 36 15 1228800 3100
42423532 goldgenius G Sept. 3, 2018, 11:33 a.m. OK GNU C++11 TESTS 36 30 0 3100
42142874 master_rat1 G Aug. 27, 2018, 6:54 a.m. OK GNU C++11 TESTS 36 30 0 3100
50425220 fzszchy2001 G Feb. 24, 2019, 11:09 a.m. OK GNU C++11 TESTS 36 30 614400 3100
52517206 was_n G April 9, 2019, 6:24 a.m. OK GNU C++11 TESTS 36 30 4403200 3100
63527815 cuizhuyefei G Oct. 27, 2019, 5:48 a.m. OK GNU C++11 TESTS 36 31 0 3100
61746054 luogu_bot5 G Oct. 3, 2019, 12:27 a.m. OK GNU C++11 TESTS 36 31 0 3100
57868947 lopare G July 27, 2019, 11:48 p.m. OK GNU C++11 TESTS 36 31 0 3100
57737820 py_ultron G July 25, 2019, 10:29 a.m. OK GNU C++11 TESTS 36 31 0 3100
54882430 LJC00118 G May 31, 2019, 3:06 p.m. OK GNU C++11 TESTS 36 31 0 3100
42000654 forelax G Aug. 23, 2018, 2:55 p.m. OK GNU C++14 TESTS 36 15 0 3100
42696065 ReaLNero1 G Sept. 9, 2018, 7:13 a.m. OK GNU C++14 TESTS 36 15 1228800 3100
41967133 cz_xuyixuan G Aug. 22, 2018, 12:56 p.m. OK GNU C++14 TESTS 36 15 1228800 3100
67856683 Scut82 G Dec. 29, 2019, 6:23 a.m. OK GNU C++14 TESTS 36 30 0 3100
55850960 Scut82 G June 21, 2019, 3:37 a.m. OK GNU C++14 TESTS 36 30 0 3100
42353000 Nero G Sept. 2, 2018, 6:48 a.m. OK GNU C++14 TESTS 36 30 0 3100
42138417 black_horse2014 G Aug. 27, 2018, 2:36 a.m. OK GNU C++14 TESTS 36 30 0 3100
55850756 Scut82 G June 21, 2019, 3:26 a.m. OK GNU C++14 TESTS 36 31 0 3100
54895894 mayaohua2003 G June 1, 2019, 2:41 a.m. OK GNU C++14 TESTS 36 31 0 3100
48873797 RobeZH G Jan. 24, 2019, 7:13 a.m. OK GNU C++14 TESTS 36 31 0 3100
49898132 HIR180 G Feb. 14, 2019, 7:58 a.m. OK GNU C++17 TESTS 36 30 0 3100
43901809 massimodong G Oct. 6, 2018, 12:45 p.m. OK GNU C++17 TESTS 36 30 0 3100
41877972 walnutwaldo20 G Aug. 19, 2018, 10:28 p.m. OK GNU C++17 TESTS 36 30 0 3100
42270800 dinosaurs G Aug. 30, 2018, 8:20 a.m. OK GNU C++17 TESTS 36 30 204800 3100
48081818 myx12345 G Jan. 8, 2019, 8:24 a.m. OK GNU C++17 TESTS 36 30 2048000 3100
57975021 vjudge4 G July 30, 2019, 7:24 a.m. OK GNU C++17 TESTS 36 30 3993600 3100
67442220 SecondThread G Dec. 22, 2019, 7:52 p.m. OK GNU C++17 TESTS 36 31 0 3100
50732781 zhaimingshuzms G March 3, 2019, 11:37 a.m. OK GNU C++17 TESTS 36 31 0 3100
43459984 visanr G Sept. 26, 2018, 4:37 p.m. OK GNU C++17 TESTS 36 31 0 3100
42879693 luogu_bot3 G Sept. 15, 2018, 5:43 a.m. OK GNU C++17 TESTS 36 31 0 3100
42876587 tri G Sept. 15, 2018, 1:39 a.m. OK Java 8 TESTS 36 124 0 3100
42150181 bsrkaditya G Aug. 27, 2018, 11:43 a.m. OK Java 8 TESTS 36 140 0 3100
41909961 profi G Aug. 20, 2018, 5:05 p.m. OK Java 8 TESTS 36 155 0 3100
41901467 sawafrolov G Aug. 20, 2018, 12:21 p.m. OK Java 8 TESTS 36 155 0 3100
41866727 Lewin G Aug. 19, 2018, 5:19 p.m. OK PyPy 2 TESTS 36 140 0 3100
41949566 scott_wu G Aug. 21, 2018, 10:52 p.m. OK PyPy 3 TESTS 36 140 0 3100
41949620 scott_wu G Aug. 21, 2018, 10:57 p.m. OK PyPy 3 TESTS 36 155 0 3100
41949542 scott_wu G Aug. 21, 2018, 10:50 p.m. OK PyPy 3 TESTS 36 155 0 3100
41968265 TianyiChen G Aug. 22, 2018, 1:31 p.m. OK Python 3 TESTS 36 109 0 3100
44903260 gooooooogol G Oct. 26, 2018, 10:09 a.m. OK Python 3 TESTS 36 124 0 3100
42009376 Dmitriy.Belichenko G Aug. 23, 2018, 9:47 p.m. OK Python 3 TESTS 36 124 0 3100
41949218 scott_wu G Aug. 21, 2018, 10:13 p.m. OK Python 3 TESTS 36 124 0 3100
41949185 scott_wu G Aug. 21, 2018, 10:09 p.m. OK Python 3 TESTS 36 124 0 3100
41949158 scott_wu G Aug. 21, 2018, 10:07 p.m. OK Python 3 TESTS 36 124 0 3100
41949139 scott_wu G Aug. 21, 2018, 10:05 p.m. OK Python 3 TESTS 36 124 0 3100
41949505 scott_wu G Aug. 21, 2018, 10:46 p.m. OK Python 3 TESTS 36 140 0 3100

remove filters

Back to search problems