Codeforces Round 245 (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
429 Codeforces Round 245 (Div. 1) FINISHED False 7200 337875597 May 11, 2014, 3:40 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 10521 ) A Xor-tree PROGRAMMING dfs and similar trees 1500

B'Iahub is very proud of his recent discovery, propagating trees. Right now, he invented a new tree, called xor-tree. After this new revolutionary discovery, he invented a game for kids which uses xor-trees. The game is played on a tree having n nodes, numbered from 1 to n. Each node i has an initial value initi, which is either 0 or 1. The root of the tree is node 1. One can perform several (possibly, zero) operations on the tree during the game. The only available type of operation is to pick a node x. Right after someone has picked node x, the value of node x flips, the values of sons of x remain the same, the values of sons of sons of x flips, the values of sons of sons of sons of x remain the same and so on. The goal of the game is to get each node i to have value goali, which can also be only 0 or 1. You need to reach the goal of the game by using minimum number of operations. The first line contains an integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89105). Each of the next n xe2 x80 x89- xe2 x80 x891 lines contains two integers ui and vi (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89ui, xe2 x80 x89vi xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n; ui xe2 x80 x89 xe2 x89 xa0 xe2 x80 x89vi) meaning there is an edge between nodes ui and vi. The next line contains n integer numbers, the i-th of them corresponds to initi (initi is either 0 or 1). The following line also contains n integer numbers, the i-th number corresponds to goali (goali is either 0 or 1). In the first line output an integer number cnt, representing the minimal number of operations you perform. Each of the next cnt lines should contain an integer xi, representing that you pick a node xi.'...

Tutorials

Codeforces Round #245 — Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
22256504 JoeBlow A Nov. 16, 2016, 3:16 a.m. OK D TESTS 35 187 11776000 1500
6588542 Gassa A May 11, 2014, 3:51 p.m. OK D TESTS 35 202 4300800 1500
6598558 Casio A May 11, 2014, 6:47 p.m. OK Delphi TESTS 35 46 3686400 1500
6610718 Misha100896 A May 13, 2014, 3:19 p.m. OK Delphi TESTS 35 46 24985600 1500
6605757 Casio A May 12, 2014, 5:57 p.m. OK Delphi TESTS 35 61 4096000 1500
6605736 Casio A May 12, 2014, 5:54 p.m. OK Delphi TESTS 35 61 4096000 1500
6598529 Casio A May 11, 2014, 6:45 p.m. OK Delphi TESTS 35 61 5632000 1500
6592420 IgorL A May 11, 2014, 4:35 p.m. OK Delphi TESTS 35 61 69017600 1500
7306341 graceoflives A Aug. 1, 2014, 9:45 a.m. OK FPC TESTS 35 46 3891200 1500
11230164 vjudge1 A May 23, 2015, 12:51 a.m. OK FPC TESTS 35 108 4812800 1500
11244554 louisja1 A May 24, 2015, 12:16 a.m. OK FPC TESTS 35 124 4812800 1500
6590726 nghiemtucboy A May 11, 2014, 4:15 p.m. OK FPC TESTS 35 124 4812800 1500
6588236 Alex_2oo8 A May 11, 2014, 3:47 p.m. OK FPC TESTS 35 124 4812800 1500
7202191 DaibaNana A July 22, 2014, 12:59 p.m. OK FPC TESTS 35 124 5017600 1500
6589033 valeriy.stromov A May 11, 2014, 3:56 p.m. OK FPC TESTS 35 124 6860800 1500
6610830 BIV A May 13, 2014, 3:44 p.m. OK FPC TESTS 35 124 18432000 1500
6712537 jrren A May 26, 2014, 12:29 a.m. OK FPC TESTS 35 124 23040000 1500
9675801 xTOMMY A Feb. 2, 2015, 12:48 p.m. OK FPC TESTS 35 124 26009600 1500
6590522 zeosutt A May 11, 2014, 4:13 p.m. OK GNU C TESTS 35 31 7782400 1500
11521213 ving.xia A June 10, 2015, 12:27 p.m. OK GNU C TESTS 35 77 1945600 1500
6985038 strider945 A June 30, 2014, 9:37 a.m. OK GNU C TESTS 35 77 6553600 1500
6612891 sky1young A May 14, 2014, 4:53 a.m. OK GNU C TESTS 35 78 6553600 1500
11132641 abhishekgarg A May 18, 2015, 8:13 a.m. OK GNU C TESTS 35 93 5427200 1500
10298763 magieNoire A March 16, 2015, 10:49 a.m. OK GNU C TESTS 35 93 7168000 1500
10298050 magieNoire A March 16, 2015, 9:11 a.m. OK GNU C TESTS 35 93 7168000 1500
18114435 TsReaper A May 27, 2016, 7:41 a.m. OK GNU C TESTS 35 93 7270400 1500
27330816 ayushrai09 A May 25, 2017, 6:56 a.m. OK GNU C TESTS 35 93 20582400 1500
7056437 aplain A July 10, 2014, 4:41 a.m. OK GNU C TESTS 35 93 43622400 1500
12461833 ExfJoe A Aug. 11, 2015, 5:44 a.m. OK GNU C++ TESTS 35 31 4710400 1500
11230312 vjudge3 A May 23, 2015, 1:10 a.m. OK GNU C++ TESTS 35 31 4710400 1500
6588306 sy2006 A May 11, 2014, 3:48 p.m. OK GNU C++ TESTS 35 31 5427200 1500
6619651 wjhuang A May 15, 2014, 9:21 a.m. OK GNU C++ TESTS 35 31 5836800 1500
6616656 OmaeWaMouShenDeiru A May 14, 2014, 5:23 p.m. OK GNU C++ TESTS 35 31 5836800 1500
9356499 iwtwiioi A Jan. 3, 2015, 11:01 p.m. OK GNU C++ TESTS 35 31 6041600 1500
6589830 zyh A May 11, 2014, 4:05 p.m. OK GNU C++ TESTS 35 31 6451200 1500
13721176 wxjlzbcd A Oct. 19, 2015, 3:12 a.m. OK GNU C++ TESTS 35 31 6553600 1500
6588115 ACMonster A May 11, 2014, 3:44 p.m. OK GNU C++ TESTS 35 31 7475200 1500
42019682 Scut82 A Aug. 24, 2018, 8:25 a.m. OK GNU C++ TESTS 35 31 7577600 1500
9966594 math10 A Feb. 23, 2015, 7:58 a.m. OK GNU C++0x TESTS 35 46 5529600 1500
6588690 MinakoKojima A May 11, 2014, 3:52 p.m. OK GNU C++0x TESTS 35 46 5632000 1500
6588145 savinov A May 11, 2014, 3:45 p.m. OK GNU C++0x TESTS 35 46 5632000 1500
8064704 chrome A Oct. 3, 2014, 3:59 a.m. OK GNU C++0x TESTS 35 46 6246400 1500
6683200 rais.fathin38 A May 22, 2014, 6:38 p.m. OK GNU C++0x TESTS 35 61 4812800 1500
6588177 persianpars A May 11, 2014, 3:46 p.m. OK GNU C++0x TESTS 35 61 5632000 1500
6588383 JohnPaulII A May 11, 2014, 3:49 p.m. OK GNU C++0x TESTS 35 62 5222400 1500
6588820 sokian A May 11, 2014, 3:54 p.m. OK GNU C++0x TESTS 35 62 5632000 1500
6588482 Xellos A May 11, 2014, 3:50 p.m. OK GNU C++0x TESTS 35 62 5632000 1500
6589836 GaryYe A May 11, 2014, 4:05 p.m. OK GNU C++0x TESTS 35 62 6041600 1500
11507211 NoSoul A June 9, 2015, 9:43 a.m. OK GNU C11 TESTS 35 249 3584000 1500
48597748 hehe6764 A Jan. 20, 2019, 6:59 a.m. OK GNU C11 TESTS 35 249 5734400 1500
16865074 isdkfj A March 22, 2016, 12:18 a.m. OK GNU C++11 TESTS 35 30 7475200 1500
54903974 Zars19 A June 1, 2019, 7:58 a.m. OK GNU C++11 TESTS 35 31 5427200 1500
18660557 _KameHameha_ A June 23, 2016, 9:17 a.m. OK GNU C++11 TESTS 35 31 5632000 1500
11094164 woyeshizuile A May 14, 2015, 1:38 a.m. OK GNU C++11 TESTS 35 46 5120000 1500
54903826 vjudge5 A June 1, 2019, 7:55 a.m. OK GNU C++11 TESTS 35 46 5427200 1500
54904029 vjudge1 A June 1, 2019, 7:59 a.m. OK GNU C++11 TESTS 35 46 5427200 1500
18658431 _KameHameha_ A June 23, 2016, 7:04 a.m. OK GNU C++11 TESTS 35 46 6553600 1500
22927894 I_See_You A Dec. 13, 2016, 1:57 p.m. OK GNU C++11 TESTS 35 46 7475200 1500
24562503 Nurseiit A Feb. 10, 2017, 5:06 a.m. OK GNU C++11 TESTS 35 46 19251200 1500
54344661 vjudge5 A May 18, 2019, 11:53 a.m. OK GNU C++11 TESTS 35 61 6144000 1500
27329064 LiChenKoh A May 25, 2017, 4:10 a.m. OK GNU C++14 TESTS 35 31 5632000 1500
60870658 vjudge3 A Sept. 19, 2019, 3:21 p.m. OK GNU C++14 TESTS 35 78 5222400 1500
63687609 ritesh1340 A Oct. 28, 2019, 11:53 p.m. OK GNU C++14 TESTS 35 78 5632000 1500
21634310 Amores A Oct. 21, 2016, 6:39 a.m. OK GNU C++14 TESTS 35 78 5632000 1500
47809812 kzvd4729 A Jan. 1, 2019, 10:26 a.m. OK GNU C++14 TESTS 35 78 6451200 1500
50404829 P00000P A Feb. 23, 2019, 8:04 p.m. OK GNU C++14 TESTS 35 78 6860800 1500
26434553 MC47 A April 16, 2017, 5:50 p.m. OK GNU C++14 TESTS 35 78 8601600 1500
64754498 ijevtic A Nov. 12, 2019, 4:24 p.m. OK GNU C++14 TESTS 35 92 6451200 1500
27530919 APwhitehat A June 2, 2017, 7:47 p.m. OK GNU C++14 TESTS 35 92 8908800 1500
30127846 sudoBug A Sept. 6, 2017, 9:51 a.m. OK GNU C++14 TESTS 35 93 4812800 1500
63086256 Pippinpaddleopsicopolis A Oct. 21, 2019, 4:40 p.m. OK GNU C++17 TESTS 35 77 4710400 1500
51732936 undercover9119 A March 22, 2019, 10:47 p.m. OK GNU C++17 TESTS 35 77 5632000 1500
44420917 ivan100sic A Oct. 16, 2018, 10:35 p.m. OK GNU C++17 TESTS 35 78 5632000 1500
65669301 FlowerOfSorrow A Nov. 24, 2019, 3:14 p.m. OK GNU C++17 TESTS 35 92 4812800 1500
64575075 lucky_21 A Nov. 9, 2019, 10:30 a.m. OK GNU C++17 TESTS 35 93 4198400 1500
59491132 PaciukZvichainyi A Aug. 25, 2019, 7:22 p.m. OK GNU C++17 TESTS 35 93 4403200 1500
51169513 kaizen19 A March 11, 2019, 3:45 p.m. OK GNU C++17 TESTS 35 93 4403200 1500
41994113 vivek_shah A Aug. 23, 2018, 10:56 a.m. OK GNU C++17 TESTS 35 93 4812800 1500
67583302 saynaaa A Dec. 25, 2019, 7:09 a.m. OK GNU C++17 TESTS 35 93 4915200 1500
69682490 mystery__coder A Jan. 28, 2020, 4:02 p.m. OK GNU C++17 TESTS 35 93 5017600 1500
6589072 OutSide A May 11, 2014, 3:57 p.m. OK Go TESTS 35 124 7987200 1500
6590657 autotaker A May 11, 2014, 4:14 p.m. OK Haskell TESTS 35 140 19763200 1500
6600491 cojna A May 12, 2014, 12:26 a.m. OK Haskell TESTS 35 202 27033600 1500
6688784 quyse A May 23, 2014, 5:41 p.m. OK Haskell TESTS 35 280 32768000 1500
69053696 zhanyi_xiaolu A Jan. 18, 2020, 1:39 p.m. OK Java 11 TESTS 35 342 16281600 1500
6588896 hiukim A May 11, 2014, 3:55 p.m. OK Java 6 TESTS 35 218 11673600 1500
7019100 xiaowuc1 A July 6, 2014, 3:36 a.m. OK Java 6 TESTS 35 264 12083200 1500
6612123 HidenoriS A May 13, 2014, 11:03 p.m. OK Java 6 TESTS 35 264 13721600 1500
6887640 jhfognzalezgo A June 14, 2014, 4:07 a.m. OK Java 6 TESTS 35 530 12697600 1500
8531687 dr.madis A Nov. 3, 2014, 6:19 a.m. OK Java 6 TESTS 35 560 16384000 1500
8805633 trunghieu11 A Nov. 22, 2014, 6:31 p.m. OK Java 7 TESTS 35 108 4608000 1500
6588784 dalex A May 11, 2014, 3:53 p.m. OK Java 7 TESTS 35 108 6144000 1500
6592947 uwi A May 11, 2014, 4:42 p.m. OK Java 7 TESTS 35 124 0 1500
6588549 Egor A May 11, 2014, 3:51 p.m. OK Java 7 TESTS 35 124 6963200 1500
8805691 trunghieu11 A Nov. 22, 2014, 6:37 p.m. OK Java 7 TESTS 35 139 4608000 1500
8805753 trunghieu11 A Nov. 22, 2014, 6:43 p.m. OK Java 7 TESTS 35 139 6963200 1500
6588606 fetetriste A May 11, 2014, 3:52 p.m. OK Java 7 TESTS 35 140 3481600 1500
6608219 KNIGHT0X300 A May 13, 2014, 7:08 a.m. OK Java 7 TESTS 35 155 6963200 1500
6590981 alex_tolstov A May 11, 2014, 4:18 p.m. OK Java 7 TESTS 35 156 4403200 1500
6592009 meijun A May 11, 2014, 4:30 p.m. OK Java 7 TESTS 35 171 6348800 1500
43455793 aman28rwt A Sept. 26, 2018, 2:58 p.m. OK Java 8 TESTS 35 139 1638400 1500
19892556 ankurverma1994 A Aug. 15, 2016, 5:01 p.m. OK Java 8 TESTS 35 139 27033600 1500
45024264 mandark27 A Oct. 28, 2018, 8:32 p.m. OK Java 8 TESTS 35 155 4812800 1500
9941203 poikniok A Feb. 20, 2015, 6:47 p.m. OK Java 8 TESTS 35 155 5017600 1500
41634915 StayAwayFromBitches A Aug. 15, 2018, 10:10 p.m. OK Java 8 TESTS 35 155 5120000 1500
39056135 prashantpiyush A June 8, 2018, 10:51 p.m. OK Java 8 TESTS 35 187 921600 1500
55614582 saurabhs1206 A June 16, 2019, 8:07 a.m. OK Java 8 TESTS 35 202 15974400 1500
48113506 bhautik_77 A Jan. 9, 2019, 11:08 a.m. OK Java 8 TESTS 35 202 80588800 1500
54059585 yoonware A May 13, 2019, 10:28 a.m. OK Java 8 TESTS 35 217 15360000 1500
22788444 eightnoteight A Dec. 7, 2016, 2:11 p.m. OK Java 8 TESTS 35 217 20582400 1500
51412726 nemars A March 17, 2019, 12:43 p.m. OK Mono C# TESTS 35 499 21606400 1500
8294908 camypaper A Oct. 18, 2014, 2:29 p.m. OK MS C# TESTS 35 78 10547200 1500
6588692 azukun A May 11, 2014, 3:52 p.m. OK MS C# TESTS 35 249 18944000 1500
10117118 aladdin3 A March 2, 2015, 11:14 a.m. OK MS C# TESTS 35 296 9728000 1500
6591300 fiver A May 11, 2014, 4:22 p.m. OK MS C# TESTS 35 343 87756800 1500
9623497 kblack A Jan. 30, 2015, 7:57 a.m. OK MS C# TESTS 35 436 18022400 1500
9623509 kblack A Jan. 30, 2015, 7:58 a.m. OK MS C# TESTS 35 436 21299200 1500
9623486 kblack A Jan. 30, 2015, 7:55 a.m. OK MS C# TESTS 35 452 18022400 1500
9623421 kblack A Jan. 30, 2015, 7:48 a.m. OK MS C# TESTS 35 467 21606400 1500
8295749 LLT A Oct. 18, 2014, 4:17 p.m. OK MS C# TESTS 35 529 17920000 1500
9623462 kblack A Jan. 30, 2015, 7:52 a.m. OK MS C# TESTS 35 608 178688000 1500
6605901 audin1000 A May 12, 2014, 6:31 p.m. OK MS C++ TESTS 35 61 4198400 1500
6588956 AcmerArthur A May 11, 2014, 3:55 p.m. OK MS C++ TESTS 35 62 4812800 1500
6589863 Rivx A May 11, 2014, 4:06 p.m. OK MS C++ TESTS 35 62 4812800 1500
54342873 vjudge1 A May 18, 2019, 11:08 a.m. OK MS C++ TESTS 35 62 5017600 1500
6589212 dovegx A May 11, 2014, 3:58 p.m. OK MS C++ TESTS 35 62 6144000 1500
54342973 vjudge5 A May 18, 2019, 11:11 a.m. OK MS C++ TESTS 35 62 7372800 1500
6728833 wangyucheng A May 28, 2014, 1:30 p.m. OK MS C++ TESTS 35 62 11776000 1500
54342282 vjudge3 A May 18, 2019, 10:53 a.m. OK MS C++ TESTS 35 77 4915200 1500
58883380 vjudge3 A Aug. 15, 2019, 11:38 p.m. OK MS C++ TESTS 35 77 4915200 1500
6611467 elshin A May 13, 2014, 6:26 p.m. OK MS C++ TESTS 35 77 5120000 1500
58512665 CtrlAlt A Aug. 9, 2019, 8:02 p.m. OK MS C++ 2017 TESTS 35 124 5120000 1500
53948776 jihee1651 A May 10, 2019, 8:21 a.m. OK MS C++ 2017 TESTS 35 124 5427200 1500
56054708 darkus-_- A June 25, 2019, 10:01 p.m. OK MS C++ 2017 TESTS 35 312 5529600 1500
64748093 yuanyuan2048 A Nov. 12, 2019, 2:15 p.m. OK MS C++ 2017 TESTS 35 467 5734400 1500
6660645 jackhftang A May 20, 2014, 4:24 a.m. OK Ocaml TESTS 35 78 4915200 1500
6723811 Darooha A May 27, 2014, 9:50 p.m. OK Ocaml TESTS 35 156 5120000 1500
30218008 iit2014101 A Sept. 9, 2017, 5:40 a.m. OK PyPy 2 TESTS 35 873 16793600 1500
65302438 chaudhary_19 A Nov. 18, 2019, 1:43 p.m. OK PyPy 2 TESTS 35 920 116428800 1500
65302286 chaudhary_19 A Nov. 18, 2019, 1:40 p.m. OK PyPy 3 TESTS 35 498 119808000 1500
52585094 Mr.Inconsistent A April 10, 2019, 10:46 p.m. OK PyPy 3 TESTS 35 576 32972800 1500
67683093 MajAK A Dec. 27, 2019, 7:27 a.m. OK PyPy 3 TESTS 35 998 21913600 1500
16276067 orailly A Feb. 22, 2016, 11:56 a.m. OK Python 2 TESTS 35 420 16691200 1500
34443025 pavankatta A Jan. 22, 2018, 10:32 a.m. OK Python 2 TESTS 35 467 21299200 1500
12693179 Rustem A Aug. 25, 2015, 8:27 a.m. OK Python 2 TESTS 35 561 17305600 1500
23416954 ShayanH A Dec. 30, 2016, 10:19 a.m. OK Python 2 TESTS 35 561 22323200 1500
65302333 chaudhary_19 A Nov. 18, 2019, 1:41 p.m. OK Python 2 TESTS 35 607 15462400 1500
10598169 SoroushE A April 5, 2015, 6:28 a.m. OK Python 2 TESTS 35 607 17715200 1500
10598206 SoroushE A April 5, 2015, 6:34 a.m. OK Python 2 TESTS 35 608 18022400 1500
10598190 SoroushE A April 5, 2015, 6:32 a.m. OK Python 2 TESTS 35 624 17920000 1500
10598154 SoroushE A April 5, 2015, 6:25 a.m. OK Python 2 TESTS 35 967 13824000 1500
55926940 anshuman16423 A June 22, 2019, 9:44 a.m. OK Python 2 TESTS 35 967 25497600 1500
56166759 Mohamed_Ayman A June 27, 2019, 2:36 p.m. OK Python 3 TESTS 35 483 14438400 1500
16275942 orailly A Feb. 22, 2016, 11:48 a.m. OK Python 3 TESTS 35 514 14745600 1500
67204637 ashok123 A Dec. 19, 2019, 12:02 p.m. OK Python 3 TESTS 35 530 12697600 1500
11139046 tomdmitriev A May 18, 2015, 9:45 p.m. OK Python 3 TESTS 35 608 14131200 1500
41985288 Mk_Python_v1 A Aug. 23, 2018, 5:39 a.m. OK Python 3 TESTS 35 623 12390400 1500
65302146 chaudhary_19 A Nov. 18, 2019, 1:37 p.m. OK Python 3 TESTS 35 623 15257600 1500
6621183 yugle7 A May 15, 2014, 1:41 p.m. OK Python 3 TESTS 35 639 13619200 1500
37438829 nowyyz A April 18, 2018, 1:50 p.m. OK Python 3 TESTS 35 639 19660800 1500
49056218 toysheeyeyraku A Jan. 27, 2019, 1:25 p.m. OK Python 3 TESTS 35 655 15667200 1500
18393890 KadiyalaSaiManoj A June 12, 2016, 3:38 p.m. OK Python 3 TESTS 35 685 141926400 1500
29940093 cympfh A Aug. 31, 2017, 10:39 a.m. OK Rust TESTS 35 186 7270400 1500
22126803 reldan A Nov. 9, 2016, 9:29 a.m. OK Scala TESTS 35 732 15769600 1500

remove filters

Back to search problems