Codeforces Round 499 (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
1010 Codeforces Round 499 (Div. 1) FINISHED False 7200 204908123 July 26, 2018, 3:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2403 ) D Mars rover PROGRAMMING dfs and similar graphs implementation trees 2100

B'Natasha travels around Mars in the Mars rover. But suddenly it broke down, namely -- the logical scheme inside it. The scheme is an undirected tree (connected acyclic graph) with a root in the vertex 1 , in which every leaf (excluding root) is an input, and all other vertices are logical elements, including the root, which is output. One bit is fed to each input. One bit is returned at the output. There are four types of logical elements: AND ( 2 inputs), OR ( 2 inputs), XOR ( 2 inputs), NOT ( 1 input). Logical elements take values from their direct descendants (inputs) and return the result of the function they perform. Natasha knows the logical scheme of the Mars rover, as well as the fact that only one input is broken. In order to fix the Mars rover, she needs to change the value on this input. For each input, determine what the output will be if Natasha changes this input. The first line contains a single integer n ( 2 <= n <= 10^6 ) -- the number of vertices in the graph (both inputs and elements). The i -th of the next n lines contains a description of i -th vertex: the first word "AND", "OR", "XOR", "NOT" or "IN" (means the input of the scheme) is the vertex type. If this vertex is "IN", then the value of this input follows ( 0 or 1 ), otherwise follow the indices of input vertices of this element: "AND", "OR", "XOR" have 2 inputs, whereas "NOT" has 1 input. The vertices are numbered from one. It is guaranteed that input data contains a correct logical scheme with an output produced by the vertex 1 . Print a string of characters '0 ' and '1 ' (without quotes) -- answers to the problem for each input in the ascending order of their vertex indices. The original scheme from the example (before the input is changed): Green indicates bits '1 ', yellow indicates bits '0 '. If Natasha changes the input bit 2 to 0 , then the output will be 1 . If Natasha chang'...

Tutorials

60851

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
40800639 Gassa D July 26, 2018, 4:13 p.m. OK D TESTS 124 1512 152166400 2100
40808653 LargeDumpling D July 26, 2018, 4:52 p.m. OK GNU C++ TESTS 124 468 56524800 2100
40800918 1152147486 D July 26, 2018, 4:14 p.m. OK GNU C++ TESTS 124 483 56524800 2100
40799954 PinkRabbit D July 26, 2018, 4:10 p.m. OK GNU C++ TESTS 124 592 51507200 2100
40794990 yasugongshang D July 26, 2018, 3:49 p.m. OK GNU C++ TESTS 124 607 84070400 2100
40806463 alex_china D July 26, 2018, 4:41 p.m. OK GNU C++ TESTS 124 623 51507200 2100
40804315 rzswh D July 26, 2018, 4:31 p.m. OK GNU C++ TESTS 124 655 24064000 2100
40796882 valorwxp D July 26, 2018, 3:56 p.m. OK GNU C++ TESTS 124 655 52326400 2100
40797778 JOHNKRAM D July 26, 2018, 4 p.m. OK GNU C++ TESTS 124 655 103116800 2100
40804610 hekai D July 26, 2018, 4:32 p.m. OK GNU C++ TESTS 124 701 51609600 2100
40803086 yybyyb D July 26, 2018, 4:25 p.m. OK GNU C++ TESTS 124 701 114892800 2100
40802197 FizzyDavicl D July 26, 2018, 4:21 p.m. OK GNU C++11 TESTS 124 311 59596800 2100
40799813 zx2003 D July 26, 2018, 4:09 p.m. OK GNU C++11 TESTS 124 311 114790400 2100
40800272 QAQAutoMaton D July 26, 2018, 4:11 p.m. OK GNU C++11 TESTS 124 312 52019200 2100
40804225 _Cwystc_Killer_ D July 26, 2018, 4:30 p.m. OK GNU C++11 TESTS 124 405 79564800 2100
40804721 zzb111 D July 26, 2018, 4:33 p.m. OK GNU C++11 TESTS 124 436 50278400 2100
40806899 Mr_Spade D July 26, 2018, 4:43 p.m. OK GNU C++11 TESTS 124 483 51302400 2100
40796582 cuizhuyefei D July 26, 2018, 3:55 p.m. OK GNU C++11 TESTS 124 483 78336000 2100
40795923 ChiliuDog D July 26, 2018, 3:52 p.m. OK GNU C++11 TESTS 124 483 82739200 2100
40804108 Blue233333 D July 26, 2018, 4:30 p.m. OK GNU C++11 TESTS 124 499 91443200 2100
40799215 miaom D July 26, 2018, 4:06 p.m. OK GNU C++11 TESTS 124 592 51507200 2100
40803355 imeimi D July 26, 2018, 4:26 p.m. OK GNU C++14 TESTS 124 592 71577600 2100
40800218 Iriskinn D July 26, 2018, 4:11 p.m. OK GNU C++14 TESTS 124 638 45568000 2100
40799740 AprilGrimoire D July 26, 2018, 4:09 p.m. OK GNU C++14 TESTS 124 639 51507200 2100
40796516 solaimanope D July 26, 2018, 3:55 p.m. OK GNU C++14 TESTS 124 654 51609600 2100
40800170 ckodser D July 26, 2018, 4:11 p.m. OK GNU C++14 TESTS 124 670 42496000 2100
40796051 Andrew_Makar D July 26, 2018, 3:53 p.m. OK GNU C++14 TESTS 124 670 49561600 2100
40804228 gs15120 D July 26, 2018, 4:30 p.m. OK GNU C++14 TESTS 124 685 24576000 2100
40809189 pedroteosousa D July 26, 2018, 4:54 p.m. OK GNU C++14 TESTS 124 685 47513600 2100
40804054 epicure D July 26, 2018, 4:29 p.m. OK GNU C++14 TESTS 124 685 48742400 2100
40800584 metatron D July 26, 2018, 4:13 p.m. OK GNU C++14 TESTS 124 685 67276800 2100
40806345 lxn D July 26, 2018, 4:41 p.m. OK GNU C++17 TESTS 124 405 111206400 2100
40800593 natsugiri D July 26, 2018, 4:13 p.m. OK GNU C++17 TESTS 124 577 18022400 2100
40800940 Ali_Pi D July 26, 2018, 4:15 p.m. OK GNU C++17 TESTS 124 670 42496000 2100
40806062 Nazikk D July 26, 2018, 4:39 p.m. OK GNU C++17 TESTS 124 670 45568000 2100
40793148 KADR D July 26, 2018, 3:41 p.m. OK GNU C++17 TESTS 124 670 67993600 2100
40799458 unreal.eugene D July 26, 2018, 4:08 p.m. OK GNU C++17 TESTS 124 685 45568000 2100
40796844 conflict D July 26, 2018, 3:56 p.m. OK GNU C++17 TESTS 124 701 45670400 2100
40805965 xh286286 D July 26, 2018, 4:39 p.m. OK GNU C++17 TESTS 124 701 71577600 2100
40796622 LiChenKoh D July 26, 2018, 3:55 p.m. OK GNU C++17 TESTS 124 717 55398400 2100
40790988 bazsi700 D July 26, 2018, 3:33 p.m. OK GNU C++17 TESTS 124 732 52531200 2100
40797050 mmaxio D July 26, 2018, 3:57 p.m. OK Java 8 TESTS 124 561 30515200 2100
40802774 Harpae D July 26, 2018, 4:23 p.m. OK Java 8 TESTS 124 686 97177600 2100
40802593 AkshajK D July 26, 2018, 4:22 p.m. OK Java 8 TESTS 124 717 81305600 2100
40791225 Petr D July 26, 2018, 3:34 p.m. OK Java 8 TESTS 124 779 30924800 2100
40794778 Lewin D July 26, 2018, 3:48 p.m. OK Java 8 TESTS 124 873 133632000 2100
40800562 sirknightingfail D July 26, 2018, 4:13 p.m. OK Java 8 TESTS 124 1060 97280000 2100
40796107 Egor D July 26, 2018, 3:53 p.m. OK Java 8 TESTS 124 1263 122675200 2100
40804113 TheColemanClassic D July 26, 2018, 4:30 p.m. OK Java 8 TESTS 124 2074 69939200 2100
40810457 fetetriste D July 26, 2018, 5 p.m. OK Java 8 TESTS 124 2589 229478400 2100
40804293 almogwald D July 26, 2018, 4:31 p.m. OK MS C++ TESTS 124 1887 52121600 2100

remove filters

Back to search problems