Codeforces Round 285 (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
501 Codeforces Round 285 (Div. 2) FINISHED False 7200 316385987 Jan. 12, 2015, 9 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5689 ) C Misha and Forest PROGRAMMING constructive algorithms data structures greedy sortings trees 1700

B'Let 's define a forest as a non-directed acyclic graph (also without loops and parallel edges). One day Misha played with the forest consisting of n vertices. For each vertex v from 0 to n xe2 x80 x89- xe2 x80 x891 he wrote down two integers, degreev and sv, were the first integer is the number of vertices adjacent to vertex v, and the second integer is the XOR sum of the numbers of vertices adjacent to v (if there were no adjacent vertices, he wrote down 0). Next day Misha couldn 't remember what graph he initially had. Misha has values degreev and sv left, though. Help him find the number of edges and the edges of the initial graph. It is guaranteed that there exists a forest that corresponds to the numbers written by Misha. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89216), the number of vertices in the graph. The i-th of the next lines contains numbers degreei and si (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89degreei xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89- xe2 x80 x891, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89si xe2 x80 x89< xe2 x80 x89216), separated by a space. In the first line print number m, the number of edges of the graph. Next print m lines, each containing two distinct numbers, a and b (0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89a xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89- xe2 x80 x891, 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89b xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89- xe2 x80 x891), corresponding to edge (a, xe2 x80 x89b). Edges can be printed in any order; vertices of the edge can also be printed in any order. The XOR sum of numbers is the result of bitwise adding numbers modulo 2. This operation exists in many modern programming languages. For example, in languages C++, Java and Python it is represented as "^", and in Pascal -- as "xor".'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
9417493 sergei.nosov C Jan. 12, 2015, 2:25 p.m. OK D TESTS 49 124 1331200 1700
9442368 izuru C Jan. 16, 2015, 11 a.m. OK D TESTS 49 233 5120000 1700
9416410 artem1416 C Jan. 12, 2015, 12:35 p.m. OK Delphi TESTS 49 61 2457600 1700
10017373 I_learn_OCaml C Feb. 25, 2015, 9:40 a.m. OK FPC TESTS 49 124 2048000 1700
18006075 Gray_58 C May 20, 2016, 2:21 p.m. OK FPC TESTS 49 139 4505600 1700
9541744 Nikiktafokusnik C Jan. 24, 2015, 7:29 p.m. OK FPC TESTS 49 140 2048000 1700
12285257 VAVAvile C July 31, 2015, 2:30 a.m. OK FPC TESTS 49 140 2457600 1700
11108520 igdor99 C May 15, 2015, 3 p.m. OK FPC TESTS 49 140 22220800 1700
9492849 DeWitt C Jan. 21, 2015, 1:10 p.m. OK FPC TESTS 49 155 1331200 1700
15913021 lerom C Feb. 9, 2016, 12:58 p.m. OK FPC TESTS 49 155 1331200 1700
9537568 nielswiles C Jan. 24, 2015, 11:40 a.m. OK FPC TESTS 49 155 1740800 1700
9446320 alc C Jan. 16, 2015, 8:49 p.m. OK FPC TESTS 49 155 2048000 1700
9411876 akunojiro C Jan. 12, 2015, 9:51 a.m. OK FPC TESTS 49 155 2457600 1700
9410919 yshui C Jan. 12, 2015, 9:36 a.m. OK GNU C TESTS 49 46 1331200 1700
9485561 Chipe1 C Jan. 20, 2015, 3 p.m. OK GNU C TESTS 49 46 1740800 1700
9454247 apt100 C Jan. 18, 2015, 7:02 a.m. OK GNU C TESTS 49 46 1945600 1700
9419508 abcde12345 C Jan. 12, 2015, 7:23 p.m. OK GNU C TESTS 49 46 1945600 1700
10659779 sanketM C April 11, 2015, 5:28 p.m. OK GNU C TESTS 49 46 2048000 1700
9410853 DigiMath C Jan. 12, 2015, 9:35 a.m. OK GNU C TESTS 49 46 2662400 1700
10525793 -LMH- C March 30, 2015, 3:01 p.m. OK GNU C TESTS 49 46 24064000 1700
9794016 ziedom C Feb. 10, 2015, 11:56 p.m. OK GNU C TESTS 49 62 2048000 1700
9413580 rajat189 C Jan. 12, 2015, 10:29 a.m. OK GNU C TESTS 49 62 4812800 1700
9416176 NULLspeed C Jan. 12, 2015, 12:15 p.m. OK GNU C TESTS 49 77 3379200 1700
12423092 yanice C Aug. 9, 2015, 8:16 a.m. OK GNU C++ TESTS 49 15 614400 1700
29947154 zyyorz C Aug. 31, 2017, 2:42 p.m. OK GNU C++ TESTS 49 15 3174400 1700
13006603 wxjlzbcd C Sept. 15, 2015, 11:49 a.m. OK GNU C++ TESTS 49 31 1228800 1700
13870995 hehe0625 C Oct. 26, 2015, 11:35 a.m. OK GNU C++ TESTS 49 31 1740800 1700
12422837 yanice C Aug. 9, 2015, 7:54 a.m. OK GNU C++ TESTS 49 31 1740800 1700
40987472 ReaLNero1 C July 30, 2018, 9:16 p.m. OK GNU C++ TESTS 49 31 3276800 1700
20350500 870380501 C Sept. 3, 2016, 1:04 a.m. OK GNU C++ TESTS 49 31 8704000 1700
13910820 130705009 C Oct. 28, 2015, 8:26 a.m. OK GNU C++ TESTS 49 46 307200 1700
12010284 gagagapapa C July 11, 2015, 3:43 p.m. OK GNU C++ TESTS 49 46 307200 1700
19471317 dhuacm2 C July 29, 2016, 3:17 a.m. OK GNU C++ TESTS 49 46 614400 1700
9428692 mateusbellomo C Jan. 14, 2015, 10:28 a.m. OK GNU C++0x TESTS 49 46 819200 1700
9422707 vaibhav3051 C Jan. 13, 2015, 10:14 a.m. OK GNU C++0x TESTS 49 46 1024000 1700
9422704 vaibhav3051 C Jan. 13, 2015, 10:13 a.m. OK GNU C++0x TESTS 49 46 1024000 1700
9548526 paw C Jan. 25, 2015, 11:59 a.m. OK GNU C++0x TESTS 49 46 1433600 1700
9937272 berendeanicolae C Feb. 20, 2015, 12:52 p.m. OK GNU C++0x TESTS 49 46 1740800 1700
9604768 knb C Jan. 28, 2015, 3:37 p.m. OK GNU C++0x TESTS 49 46 1740800 1700
9418356 ParanoidAndroid C Jan. 12, 2015, 4:08 p.m. OK GNU C++0x TESTS 49 46 1843200 1700
9423302 sergioRG C Jan. 13, 2015, 12:24 p.m. OK GNU C++0x TESTS 49 46 1843200 1700
9419171 fanatique C Jan. 12, 2015, 6:20 p.m. OK GNU C++0x TESTS 49 46 1843200 1700
9418188 maksay C Jan. 12, 2015, 3:48 p.m. OK GNU C++0x TESTS 49 46 1843200 1700
11531504 NoSoul C June 11, 2015, 10:22 a.m. OK GNU C11 TESTS 49 295 2150400 1700
11519230 NoSoul C June 10, 2015, 9:18 a.m. OK GNU C11 TESTS 49 311 3174400 1700
39739082 pakili C June 28, 2018, 10:01 a.m. OK GNU C11 TESTS 49 327 1638400 1700
15709570 norhh C Jan. 31, 2016, 3:20 p.m. OK GNU C11 TESTS 49 327 1945600 1700
14749357 DrompiX C Dec. 10, 2015, 7:10 p.m. OK GNU C++11 TESTS 49 46 512000 1700
19443045 abigcat C July 27, 2016, 1:34 p.m. OK GNU C++11 TESTS 49 46 614400 1700
16325269 TooEasyGames C Feb. 25, 2016, 11:14 a.m. OK GNU C++11 TESTS 49 46 614400 1700
22090746 LSY_is_retired C Nov. 7, 2016, 8:38 a.m. OK GNU C++11 TESTS 49 46 819200 1700
11414764 xxxyyyzzz C June 4, 2015, 2:19 p.m. OK GNU C++11 TESTS 49 46 819200 1700
19468931 vjudge3 C July 28, 2016, 10:10 p.m. OK GNU C++11 TESTS 49 46 1126400 1700
19471827 dhuacm9 C July 29, 2016, 4:15 a.m. OK GNU C++11 TESTS 49 46 1228800 1700
57887121 lopare C July 28, 2019, 10:25 a.m. OK GNU C++11 TESTS 49 46 1228800 1700
63774149 luogu_bot1 C Oct. 30, 2019, 8:57 a.m. OK GNU C++11 TESTS 49 46 1228800 1700
63774380 luogu_bot2 C Oct. 30, 2019, 9:01 a.m. OK GNU C++11 TESTS 49 46 1228800 1700
22154153 A_Le_K C Nov. 10, 2016, 7:20 p.m. OK GNU C++14 TESTS 49 46 1740800 1700
29905673 aglovatto C Aug. 30, 2017, 1:57 a.m. OK GNU C++14 TESTS 49 46 1945600 1700
65656119 vjudge5 C Nov. 24, 2019, 10:42 a.m. OK GNU C++14 TESTS 49 46 2252800 1700
33614037 farukkastamonuda C Dec. 25, 2017, 10:34 a.m. OK GNU C++14 TESTS 49 46 2969600 1700
23779155 theoneadmired C Jan. 13, 2017, 7:42 a.m. OK GNU C++14 TESTS 49 46 3481600 1700
25384667 stostap C March 10, 2017, 4:52 p.m. OK GNU C++14 TESTS 49 46 3788800 1700
31544281 nhtrnm C Oct. 20, 2017, 8:16 p.m. OK GNU C++14 TESTS 49 46 3788800 1700
28502748 barsa492 C July 13, 2017, 12:52 p.m. OK GNU C++14 TESTS 49 46 4096000 1700
31592064 deepcpp C Oct. 22, 2017, 5:14 a.m. OK GNU C++14 TESTS 49 46 4300800 1700
32883269 nonis C Dec. 2, 2017, 7:16 p.m. OK GNU C++14 TESTS 49 46 4300800 1700
47328241 vjudge5 C Dec. 21, 2018, 11:32 a.m. OK GNU C++17 TESTS 49 46 32358400 1700
49855303 vjudge2 C Feb. 13, 2019, 6:52 a.m. OK GNU C++17 TESTS 49 62 819200 1700
59653706 dmkwis C Aug. 29, 2019, 9:23 a.m. OK GNU C++17 TESTS 49 62 819200 1700
65926459 Chaska C Nov. 28, 2019, 6:33 p.m. OK GNU C++17 TESTS 49 62 1024000 1700
54892889 pedroh C May 31, 2019, 10:12 p.m. OK GNU C++17 TESTS 49 62 1843200 1700
54862632 chanpin C May 31, 2019, 3:41 a.m. OK GNU C++17 TESTS 49 62 1843200 1700
68233343 Anachor C Jan. 5, 2020, 10:01 a.m. OK GNU C++17 TESTS 49 62 1843200 1700
63729017 naimishsingh C Oct. 29, 2019, 1:29 p.m. OK GNU C++17 TESTS 49 62 1843200 1700
63707541 vjudge1 C Oct. 29, 2019, 8:54 a.m. OK GNU C++17 TESTS 49 62 1843200 1700
55956598 viajero C June 23, 2019, 7:23 a.m. OK GNU C++17 TESTS 49 62 1843200 1700
9422149 changyuheng C Jan. 13, 2015, 8:24 a.m. OK Go TESTS 49 156 3584000 1700
9422104 changyuheng C Jan. 13, 2015, 8:14 a.m. OK Go TESTS 49 171 2355200 1700
9429179 marcose18 C Jan. 14, 2015, 12:51 p.m. OK Java 6 TESTS 49 140 0 1700
9433379 siddv C Jan. 15, 2015, 4:20 a.m. OK Java 6 TESTS 49 155 0 1700
9416537 nanikaka C Jan. 12, 2015, 12:45 p.m. OK Java 6 TESTS 49 514 0 1700
9418254 kOlOiT C Jan. 12, 2015, 3:56 p.m. OK Java 6 TESTS 49 670 0 1700
9416565 nanikaka C Jan. 12, 2015, 12:47 p.m. OK Java 6 TESTS 49 686 0 1700
9420259 Titandrake C Jan. 12, 2015, 10:04 p.m. OK Java 6 TESTS 49 811 0 1700
13251266 suigingin C Sept. 27, 2015, 3:17 p.m. OK Java 7 TESTS 49 124 0 1700
9534484 hadrianang C Jan. 24, 2015, 6:04 a.m. OK Java 7 TESTS 49 124 0 1700
9432896 upsolving C Jan. 15, 2015, 2:06 a.m. OK Java 7 TESTS 49 124 0 1700
9419777 Aidos C Jan. 12, 2015, 8:10 p.m. OK Java 7 TESTS 49 124 0 1700
9672082 timurtibeyev C Feb. 2, 2015, 5:32 a.m. OK Java 7 TESTS 49 139 0 1700
10547682 Yeison_Garcia C April 2, 2015, 4:26 a.m. OK Java 7 TESTS 49 140 0 1700
9607124 sweiss C Jan. 28, 2015, 7:06 p.m. OK Java 7 TESTS 49 140 0 1700
9485204 di_halt C Jan. 20, 2015, 2:16 p.m. OK Java 7 TESTS 49 140 0 1700
9420737 brian C Jan. 13, 2015, 1:50 a.m. OK Java 7 TESTS 49 140 0 1700
9415341 joney_000 C Jan. 12, 2015, 11:27 a.m. OK Java 7 TESTS 49 140 0 1700
41440205 aman28rwt C Aug. 10, 2018, 5:45 p.m. OK Java 8 TESTS 49 140 0 1700
55678450 prakhar897 C June 17, 2019, 11:47 a.m. OK Java 8 TESTS 49 155 0 1700
53796003 mennafadali C May 5, 2019, 3:20 p.m. OK Java 8 TESTS 49 155 0 1700
39214957 kanak893 C June 13, 2018, 11:39 a.m. OK Java 8 TESTS 49 155 0 1700
30868350 parth_15 C Sept. 30, 2017, 1:51 p.m. OK Java 8 TESTS 49 155 0 1700
27921289 coderbond007 C June 20, 2017, 9:15 a.m. OK Java 8 TESTS 49 155 0 1700
21881902 U_Square C Oct. 29, 2016, 7:46 p.m. OK Java 8 TESTS 49 155 0 1700
16292284 i_Love_Jaiman C Feb. 23, 2016, 12:34 p.m. OK Java 8 TESTS 49 155 0 1700
19229282 arrrhh C July 19, 2016, 10:05 a.m. OK Java 8 TESTS 49 156 0 1700
65209011 AhmedZ C Nov. 16, 2019, 5:22 p.m. OK Java 8 TESTS 49 170 0 1700
31184823 darkkcyan C Oct. 10, 2017, 8:52 a.m. OK JavaScript TESTS 49 280 12800000 1700
23479228 JoeBlow C Jan. 1, 2017, 6:51 a.m. OK Kotlin TESTS 49 140 20684800 1700
23479529 JoeBlow C Jan. 1, 2017, 7:22 a.m. OK Kotlin TESTS 49 155 20787200 1700
23478698 JoeBlow C Jan. 1, 2017, 5:55 a.m. OK Kotlin TESTS 49 327 22016000 1700
13910549 Hepic_Antony_Skarlatos C Oct. 28, 2015, 8:04 a.m. OK Mono C# TESTS 49 218 5017600 1700
27949802 artsin666 C June 21, 2017, 4:40 p.m. OK MS C# TESTS 49 109 17920000 1700
13112416 og.kostya C Sept. 20, 2015, 9:56 a.m. OK MS C# TESTS 49 140 6451200 1700
9415457 mircea85 C Jan. 12, 2015, 11:30 a.m. OK MS C# TESTS 49 155 9728000 1700
9428927 azukun C Jan. 14, 2015, 11:29 a.m. OK MS C# TESTS 49 155 12083200 1700
9412748 Lurr C Jan. 12, 2015, 10:10 a.m. OK MS C# TESTS 49 265 7987200 1700
9412807 marshmallow C Jan. 12, 2015, 10:11 a.m. OK MS C# TESTS 49 280 7782400 1700
10288106 marshmallow C March 15, 2015, 12:29 p.m. OK MS C# TESTS 49 296 10956800 1700
9445932 wielkimiodas C Jan. 16, 2015, 7:22 p.m. OK MS C# TESTS 49 358 14131200 1700
18702468 Mem C June 24, 2016, 2:17 p.m. OK MS C# TESTS 49 405 16588800 1700
9416476 balalaika C Jan. 12, 2015, 12:40 p.m. OK MS C++ TESTS 49 46 512000 1700
10127435 Lingsong C March 3, 2015, 2:21 a.m. OK MS C++ TESTS 49 46 716800 1700
9427708 gs11008 C Jan. 14, 2015, 7:17 a.m. OK MS C++ TESTS 49 46 716800 1700
9447148 Zhangcanjie C Jan. 17, 2015, 2:39 a.m. OK MS C++ TESTS 49 46 819200 1700
9967993 mlepehin C Feb. 23, 2015, 10:28 a.m. OK MS C++ TESTS 49 46 1024000 1700
12157242 vjudge5 C July 22, 2015, 3:07 a.m. OK MS C++ TESTS 49 46 1126400 1700
9421446 Gyb3243 C Jan. 13, 2015, 5:30 a.m. OK MS C++ TESTS 49 46 1228800 1700
9421683 KAMYAR.DARVISHI C Jan. 13, 2015, 6:39 a.m. OK MS C++ TESTS 49 46 1843200 1700
65657544 vjudge3 C Nov. 24, 2019, 11:06 a.m. OK MS C++ TESTS 49 46 1843200 1700
12144028 vjudge5 C July 21, 2015, 8:15 a.m. OK MS C++ TESTS 49 46 2150400 1700
54307328 CtrlAlt C May 17, 2019, 4:43 p.m. OK MS C++ 2017 TESTS 49 124 4812800 1700
9794632 DarthShrine C Feb. 11, 2015, 3:29 a.m. OK Ocaml TESTS 49 124 3686400 1700
9794695 DarthShrine C Feb. 11, 2015, 3:51 a.m. OK Ocaml TESTS 49 124 4198400 1700
27999753 akshay125 C June 24, 2017, 7:36 a.m. OK PyPy 2 TESTS 49 795 32972800 1700
64782501 homoeconomicus C Nov. 13, 2019, 7:48 a.m. OK PyPy 3 TESTS 49 733 12697600 1700
11316618 fuzzz3r C May 27, 2015, 9:36 a.m. OK Python 2 TESTS 49 327 3481600 1700
9539630 Guty C Jan. 24, 2015, 3:18 p.m. OK Python 2 TESTS 49 327 3788800 1700
9605823 clarinet758 C Jan. 28, 2015, 4:59 p.m. OK Python 2 TESTS 49 343 3174400 1700
9416535 woyeshizuile C Jan. 12, 2015, 12:45 p.m. OK Python 2 TESTS 49 343 3788800 1700
12226789 thepotatoranch C July 25, 2015, 7:33 p.m. OK Python 2 TESTS 49 343 6246400 1700
9965007 Edward2173 C Feb. 23, 2015, 3:15 a.m. OK Python 2 TESTS 49 343 6758400 1700
9426171 justforlaugh C Jan. 13, 2015, 9:40 p.m. OK Python 2 TESTS 49 358 6553600 1700
9426166 justforlaugh C Jan. 13, 2015, 9:38 p.m. OK Python 2 TESTS 49 358 6553600 1700
9426163 justforlaugh C Jan. 13, 2015, 9:35 p.m. OK Python 2 TESTS 49 358 6860800 1700
9454104 nealzane C Jan. 18, 2015, 6:28 a.m. OK Python 2 TESTS 49 358 9420800 1700
9420964 orailly C Jan. 13, 2015, 3:09 a.m. OK Python 3 TESTS 49 358 10444800 1700
9420189 orailly C Jan. 12, 2015, 9:43 p.m. OK Python 3 TESTS 49 358 11673600 1700
9414371 orailly C Jan. 12, 2015, 10:48 a.m. OK Python 3 TESTS 49 451 20582400 1700
11180491 tomdmitriev C May 20, 2015, 4:58 p.m. OK Python 3 TESTS 49 498 16486400 1700
11180478 tomdmitriev C May 20, 2015, 4:56 p.m. OK Python 3 TESTS 49 530 15872000 1700
54312525 Chizhonkova C May 17, 2019, 5:07 p.m. OK Python 3 TESTS 49 561 2867200 1700
12221219 Vasiliy_48 C July 25, 2015, 4:58 a.m. OK Python 3 TESTS 49 592 2969600 1700
54320307 shirokoff C May 17, 2019, 8:39 p.m. OK Python 3 TESTS 49 623 10547200 1700
9420956 orailly C Jan. 13, 2015, 3:07 a.m. OK Python 3 TESTS 49 639 5222400 1700
9413031 moyamo C Jan. 12, 2015, 10:16 a.m. OK Python 3 TESTS 49 685 8806400 1700
9424678 instantkill C Jan. 13, 2015, 4:15 p.m. OK Ruby TESTS 49 358 1228800 1700
9424751 instantkill C Jan. 13, 2015, 4:30 p.m. OK Ruby TESTS 49 358 1536000 1700
35883919 ______u______ C March 3, 2018, 1:03 p.m. OK Ruby TESTS 49 358 7884800 1700
35883573 ______n______ C March 3, 2018, 12:56 p.m. OK Ruby TESTS 49 358 7884800 1700
35882829 _____k_____ C March 3, 2018, 12:44 p.m. OK Ruby TESTS 49 358 7884800 1700
35875498 _____i_____ C March 3, 2018, 8:19 a.m. OK Ruby TESTS 49 358 7884800 1700
35872365 ______h______ C March 3, 2018, 7:10 a.m. OK Ruby TESTS 49 358 7884800 1700
35872298 ______k______ C March 3, 2018, 7:08 a.m. OK Ruby TESTS 49 358 7884800 1700
35871565 ______i______ C March 3, 2018, 6:52 a.m. OK Ruby TESTS 49 358 7884800 1700
35864310 ______M______ C March 2, 2018, 11:06 p.m. OK Ruby TESTS 49 358 7884800 1700
10039175 Axiometry C Feb. 27, 2015, 1:59 a.m. OK Scala TESTS 49 795 409600 1700

remove filters

Back to search problems