Codeforces Round 503 (by SIS, Div. 1)

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
1019 Codeforces Round 503 (by SIS, Div. 1) FINISHED False 7200 203185463 Aug. 11, 2018, 1:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1152 ) C Sergey's problem PROGRAMMING constructive algorithms graphs 2800

B"Sergey just turned five years old! When he was one year old, his parents gave him a number; when he was two years old, his parents gave him an array of integers. On his third birthday he received a string. When he was four, his mother woke him up in a quiet voice, wished him to be a good boy and gave him a rooted tree. Today he celebrates his birthday again! He found a directed graph without loops as a present from his parents. Since Sergey is a very curious boy, he immediately came up with a thing to do. He decided to find a set Q of vertices in this graph, such that no two vertices x, y in Q are connected by an edge, and it is possible to reach any vertex z notin Q from some vertex of Q in no more than two moves. After a little thought, Sergey was able to solve this task. Can you solve it too? A vertex y is reachable from a vertex x in at most two moves if either there is a directed edge (x,y) , or there exist two directed edges (x,z) and (z, y) for some vertex z . The first line of input contains two positive integers n and m ( 1 <= n <= 1 ,000 ,000 , 1 <= m <= 1 ,000 ,000 ) -- the number of vertices and the number of edges in the directed graph. Each of the following m lines describes a corresponding edge. Each one contains two integers a_i and b_i ( 1 <= a_i, b_i <= n , a_i ne b_i ) -- the beginning and the end of the i -th edge. The graph may contain multiple edges between the same pair of vertices. First print the number k -- the number of selected vertices. Then print k distinct integers -- the indices of the selected vertices. If multiple answers exist you can output any of them. In particular, you don't have to minimize the number of vertices in the set. It is guaranteed, that there is always at least one valid set. In the first sample, the vertices 1, 3, 4, 5 are not connected. The vertex 2 i"...

Tutorials

61161

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
41951988 __ShaW C Aug. 22, 2018, 2:26 a.m. OK FPC TESTS 41 1606 63590400 2800
41531439 zhouzhendong C Aug. 12, 2018, 2:42 p.m. OK GNU C++ TESTS 41 234 20070400 2800
41531471 zhouzhendong C Aug. 12, 2018, 2:43 p.m. OK GNU C++ TESTS 41 248 20070400 2800
41491682 Panole233 C Aug. 11, 2018, 2:56 p.m. OK GNU C++ TESTS 41 248 50790400 2800
41531243 zhouzhendong C Aug. 12, 2018, 2:37 p.m. OK GNU C++ TESTS 41 249 20070400 2800
41509593 Drin_E C Aug. 12, 2018, 1:06 a.m. OK GNU C++ TESTS 41 249 57958400 2800
41531366 zhouzhendong C Aug. 12, 2018, 2:40 p.m. OK GNU C++ TESTS 41 264 20070400 2800
41639037 Duan2 C Aug. 16, 2018, 3:29 a.m. OK GNU C++ TESTS 41 280 30720000 2800
41614514 luogu_bot3 C Aug. 15, 2018, 8:16 a.m. OK GNU C++ TESTS 41 295 20070400 2800
41614496 hoki_plus C Aug. 15, 2018, 8:15 a.m. OK GNU C++ TESTS 41 295 20070400 2800
41509441 samjia2000 C Aug. 12, 2018, 12:57 a.m. OK GNU C++ TESTS 41 311 17100800 2800
42766526 luogu_bot4 C Sept. 11, 2018, 1:26 p.m. OK GNU C++11 TESTS 41 171 13824000 2800
42766511 fks20011206 C Sept. 11, 2018, 1:26 p.m. OK GNU C++11 TESTS 41 171 13824000 2800
42721543 ReaLNero1 C Sept. 10, 2018, 2:10 a.m. OK GNU C++11 TESTS 41 218 20070400 2800
41510530 shzr C Aug. 12, 2018, 1:51 a.m. OK GNU C++11 TESTS 41 218 20070400 2800
49828486 remoon C Feb. 12, 2019, 12:49 p.m. OK GNU C++11 TESTS 41 233 20070400 2800
42212599 tuwuna C Aug. 28, 2018, 3:11 p.m. OK GNU C++11 TESTS 41 233 20070400 2800
41510544 shzr C Aug. 12, 2018, 1:52 a.m. OK GNU C++11 TESTS 41 233 20070400 2800
44700526 b_j_q C Oct. 22, 2018, 2:38 p.m. OK GNU C++11 TESTS 41 234 20070400 2800
45041043 luogu_bot5 C Oct. 29, 2018, 10:18 a.m. OK GNU C++11 TESTS 41 248 32256000 2800
46919860 luogu_bot5 C Dec. 12, 2018, 3:23 a.m. OK GNU C++11 TESTS 41 248 35942400 2800
41502756 wleung_bvg C Aug. 11, 2018, 6:12 p.m. OK GNU C++14 TESTS 41 592 48947200 2800
41561952 DEMOPON C Aug. 13, 2018, 2:50 p.m. OK GNU C++14 TESTS 41 608 20992000 2800
41502661 wleung_bvg C Aug. 11, 2018, 6:08 p.m. OK GNU C++14 TESTS 41 608 64409600 2800
41530705 consecutivelimit C Aug. 12, 2018, 2:19 p.m. OK GNU C++14 TESTS 41 623 20992000 2800
44713056 pavkal5 C Oct. 22, 2018, 7:50 p.m. OK GNU C++14 TESTS 41 654 27545600 2800
49642499 DeadPillow C Feb. 8, 2019, 11:51 p.m. OK GNU C++14 TESTS 41 654 30310400 2800
44422245 iftest614 C Oct. 17, 2018, 12:19 a.m. OK GNU C++14 TESTS 41 654 33075200 2800
44779493 sdnr1 C Oct. 24, 2018, 3:49 p.m. OK GNU C++14 TESTS 41 654 51814400 2800
41803800 ekzhang C Aug. 18, 2018, 8:14 p.m. OK GNU C++14 TESTS 41 655 32256000 2800
41614105 yzyyylx C Aug. 15, 2018, 8:03 a.m. OK GNU C++14 TESTS 41 655 35430400 2800
56641563 Romeolong C July 7, 2019, 2:16 a.m. OK GNU C++17 TESTS 41 249 31027200 2800
41539644 walnutwaldo20 C Aug. 12, 2018, 9:07 p.m. OK GNU C++17 TESTS 41 451 30310400 2800
44526714 tEMMIE.w. C Oct. 19, 2018, 3:20 a.m. OK GNU C++17 TESTS 41 529 24268800 2800
42006495 Holidin C Aug. 23, 2018, 6:52 p.m. OK GNU C++17 TESTS 41 639 20992000 2800
41529528 Als123 C Aug. 12, 2018, 1:46 p.m. OK GNU C++17 TESTS 41 639 25804800 2800
41541748 lcclcc C Aug. 13, 2018, 12:41 a.m. OK GNU C++17 TESTS 41 639 30003200 2800
42730816 vjudge3 C Sept. 10, 2018, 11:27 a.m. OK GNU C++17 TESTS 41 670 24064000 2800
51464875 ytrsk C March 18, 2019, 11:47 p.m. OK GNU C++17 TESTS 41 670 30412800 2800
41638698 LBJHan C Aug. 16, 2018, 3:10 a.m. OK GNU C++17 TESTS 41 670 30412800 2800
41634899 Egor.Lifar C Aug. 15, 2018, 10:08 p.m. OK GNU C++17 TESTS 41 686 35532800 2800
66892513 Harpae C Dec. 14, 2019, 9:36 p.m. OK Java 8 TESTS 41 811 104652800 2800
41596323 uwi C Aug. 14, 2018, 5:02 p.m. OK Java 8 TESTS 41 857 88576000 2800
42476461 HardikDobariya C Sept. 4, 2018, 11:07 p.m. OK Java 8 TESTS 41 935 77721600 2800
57405560 beginner1010 C July 20, 2019, 4:39 p.m. OK Java 8 TESTS 41 1622 230604800 2800
41533625 Intrincantation C Aug. 12, 2018, 4:05 p.m. OK Java 8 TESTS 41 1653 142028800 2800
57404430 beginner1010 C July 20, 2019, 4:34 p.m. OK Java 8 TESTS 41 1684 230604800 2800
42348917 wjfwjfwjf C Sept. 2, 2018, 2:41 a.m. OK MS C++ TESTS 41 685 33587200 2800

remove filters

Back to search problems