Codeforces Round 554 (Div. 2)

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
1152 Codeforces Round 554 (Div. 2) FINISHED False 7200 181063463 April 24, 2019, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1003 ) E Neko and Flashback PROGRAMMING constructive algorithms dfs and similar graphs 2500

B"A permutation of length k is a sequence of k integers from 1 to k containing each integer exactly once. For example, the sequence [3, 1, 2] is a permutation of length 3 . When Neko was five, he thought of an array a of n positive integers and a permutation p of length n - 1 . Then, he performed the following: For example, if the array a was [3, 4, 6, 5, 7] and permutation p was [2, 4, 1, 3] , then Neko would have constructed the following arrays: Then, he wrote two arrays b' and c' on a piece of paper and forgot about it. 14 years later, when he was cleaning up his room, he discovered this old piece of paper with two arrays b' and c' written on it. However he can't remember the array a and permutation p he used. In case Neko made a mistake and there is no array a and permutation p resulting in such b' and c' , print -1. Otherwise, help him recover any possible array a . The first line contains an integer n ( 2 <= q n <= q 10^5 ) -- the number of elements in array a . The second line contains n-1 integers b'_1, b'_2, ldots, b'_{n-1} ( 1 <= q b'_i <= q 10^9 ). The third line contains n-1 integers c'_1, c'_2, ldots, c'_{n-1} ( 1 <= q c'_i <= q 10^9 ). If Neko made a mistake and there is no array a and a permutation p leading to the b' and c' , print -1. Otherwise, print n positive integers a_i ( 1 <= a_i <= 10^9 ), denoting the elements of the array a . If there are multiple possible solutions, print any of them. The first example is explained is the problem statement. In the third example, for a = [3, 4, 5, 2, 1, 4, 3, 2] , a possible permutation p is [7, 1, 5, 4, 3, 2, 6] . In that case, Neko would have constructed the following arrays: "...

Tutorials

T

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
53253220 rainboy E April 24, 2019, 4:23 p.m. OK GNU C11 TESTS 91 483 9830400 2500
54377083 Connected_failed E May 19, 2019, 9:15 a.m. OK GNU C++11 TESTS 91 93 6656000 2500
53324209 Dilute E April 26, 2019, 2:37 p.m. OK GNU C++11 TESTS 91 93 7680000 2500
53389886 Dilute E April 27, 2019, 6:27 a.m. OK GNU C++11 TESTS 91 93 7680000 2500
53285764 littleming E April 25, 2019, 1:49 p.m. OK GNU C++11 TESTS 91 93 7987200 2500
53285729 wjyyy E April 25, 2019, 1:49 p.m. OK GNU C++11 TESTS 91 93 8601600 2500
55611110 ReaLNero1 E June 16, 2019, 5:47 a.m. OK GNU C++11 TESTS 91 93 8601600 2500
53430692 Cothrax E April 27, 2019, 4:07 p.m. OK GNU C++11 TESTS 91 93 13926400 2500
57083256 luogu_bot3 E July 15, 2019, 7:55 a.m. OK GNU C++11 TESTS 91 93 43315200 2500
53811930 Iizimayun E May 6, 2019, 7:28 a.m. OK GNU C++11 TESTS 91 108 15462400 2500
53490100 Master_Yi E April 29, 2019, 7:57 a.m. OK GNU C++11 TESTS 91 109 7782400 2500
53298327 davidberard E April 25, 2019, 6:47 p.m. OK GNU C++14 TESTS 91 77 18022400 2500
53281709 OmarHashim E April 25, 2019, 12:16 p.m. OK GNU C++14 TESTS 91 124 13414400 2500
54895521 huyufeifei E June 1, 2019, 2:18 a.m. OK GNU C++14 TESTS 91 124 13824000 2500
53273180 zstu_MingSD E April 25, 2019, 7:45 a.m. OK GNU C++14 TESTS 91 124 13926400 2500
66604488 Neuni E Dec. 10, 2019, 5:53 p.m. OK GNU C++14 TESTS 91 124 14848000 2500
54895205 huyufeifei E June 1, 2019, 1:54 a.m. OK GNU C++14 TESTS 91 124 15462400 2500
53610638 zxdd0822 E May 1, 2019, 12:51 p.m. OK GNU C++14 TESTS 91 124 16179200 2500
53633504 Artistic_Fantasy E May 1, 2019, 3:48 p.m. OK GNU C++14 TESTS 91 139 8089600 2500
59605472 bojverdict1 E Aug. 28, 2019, 8:34 a.m. OK GNU C++14 TESTS 91 139 9011200 2500
53472681 ChengLongZhu_TTTTTTTT E April 28, 2019, 1:37 p.m. OK GNU C++14 TESTS 91 139 12288000 2500
53279371 nickluo E April 25, 2019, 11:17 a.m. OK GNU C++17 TESTS 91 124 14028800 2500
55836971 xuanbach E June 20, 2019, 3:51 p.m. OK GNU C++17 TESTS 91 124 14950400 2500
53265617 emengdeath E April 25, 2019, 1:08 a.m. OK GNU C++17 TESTS 91 124 18227200 2500
53265571 emengdeath E April 25, 2019, 1:05 a.m. OK GNU C++17 TESTS 91 124 18227200 2500
53271858 RUSH_D_CAT E April 25, 2019, 6:54 a.m. OK GNU C++17 TESTS 91 124 19251200 2500
53309301 FoolishMe E April 26, 2019, 5:21 a.m. OK GNU C++17 TESTS 91 124 39014400 2500
53259662 wxx_louisa E April 24, 2019, 6:33 p.m. OK GNU C++17 TESTS 91 124 71372800 2500
53263286 Anachor E April 24, 2019, 10:11 p.m. OK GNU C++17 TESTS 91 139 11468800 2500
54515039 wwwxxxddd E May 23, 2019, 9:21 a.m. OK GNU C++17 TESTS 91 139 12390400 2500
57324324 Vexoben E July 19, 2019, 11:26 a.m. OK GNU C++17 TESTS 91 139 14131200 2500
53438487 mikkk E April 27, 2019, 8:56 p.m. OK Java 8 TESTS 91 405 51200000 2500
53306161 dalt E April 26, 2019, 3:17 a.m. OK Java 8 TESTS 91 405 72806400 2500
53260496 Dukkha E April 24, 2019, 7:05 p.m. OK Java 8 TESTS 91 420 19558400 2500
53394233 uwi E April 27, 2019, 8:22 a.m. OK Java 8 TESTS 91 436 46592000 2500
53394428 uwi E April 27, 2019, 8:27 a.m. OK Java 8 TESTS 91 467 65433600 2500
53276858 zhishou E April 25, 2019, 9:56 a.m. OK Java 8 TESTS 91 545 63180800 2500
54533102 about E May 23, 2019, 6:12 p.m. OK Java 8 TESTS 91 577 60620800 2500
53379325 wadissimo E April 26, 2019, 9:15 p.m. OK Java 8 TESTS 91 592 73216000 2500
53296996 Noureldin E April 25, 2019, 5:59 p.m. OK Java 8 TESTS 91 624 42086400 2500
53296973 Noureldin E April 25, 2019, 5:58 p.m. OK Java 8 TESTS 91 655 42086400 2500
53260217 elizarov E April 24, 2019, 6:54 p.m. OK Kotlin TESTS 91 794 52838400 2500
53391363 mircea85 E April 27, 2019, 7:02 a.m. OK Mono C# TESTS 91 233 49766400 2500
54534523 claw88 E May 23, 2019, 7:06 p.m. OK Mono C# TESTS 91 311 41164800 2500
57965331 wawahaha E July 30, 2019, 2:25 a.m. OK MS C++ TESTS 91 217 62566400 2500
58316340 wawahaha E Aug. 5, 2019, 3:07 a.m. OK MS C++ TESTS 91 296 10854400 2500
58316173 wawahaha E Aug. 5, 2019, 3:02 a.m. OK MS C++ TESTS 91 311 62566400 2500
58269298 wawahaha E Aug. 4, 2019, 4:09 p.m. OK MS C++ TESTS 91 327 62566400 2500
54273414 2017111799yjl E May 17, 2019, 9:54 a.m. OK MS C++ 2017 TESTS 91 218 19046400 2500
53771249 Lordxx E May 5, 2019, 5:26 a.m. OK MS C++ 2017 TESTS 91 265 25190400 2500
53430219 Miris E April 27, 2019, 3:52 p.m. OK MS C++ 2017 TESTS 91 545 23040000 2500
53296315 Helli.code E April 25, 2019, 5:44 p.m. OK PyPy 2 TESTS 91 405 54579200 2500
53270644 pineriver E April 25, 2019, 6 a.m. OK PyPy 3 TESTS 91 826 41676800 2500
53249421 nwi E April 24, 2019, 4:05 p.m. OK Python 2 TESTS 91 686 49049600 2500
53396561 jorgeduarte E April 27, 2019, 9:28 a.m. OK Python 3 TESTS 91 1200 70963200 2500

remove filters

Back to search problems