Codeforces Round 232 (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
396 Codeforces Round 232 (Div. 1) FINISHED False 7200 338394599 Feb. 26, 2014, 3:30 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1607 ) C On Changing Tree PROGRAMMING data structures graphs trees

B'You are given a rooted tree consisting of n vertices numbered from 1 to n. The root of the tree is a vertex number 1. Initially all vertices contain number 0. Then come q queries, each query has one of the two types: Process the queries given in the input. The first line contains integer n (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n xe2 x80 x89 xe2 x89 xa4 xe2 x80 x893 xc2 xb7105) -- the number of vertices in the tree. The second line contains n xe2 x80 x89- xe2 x80 x891 integers p2, xe2 x80 x89p3, xe2 x80 x89... pn (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89pi xe2 x80 x89< xe2 x80 x89i), where pi is the number of the vertex that is the parent of vertex i in the tree. The third line contains integer q (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89q xe2 x80 x89 xe2 x89 xa4 xe2 x80 x893 xc2 xb7105) -- the number of queries. Next q lines contain the queries, one per line. The first number in the line is type. It represents the type of the query. If type xe2 x80 x89= xe2 x80 x891, then next follow space-separated integers v, xe2 x80 x89x, xe2 x80 x89k (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n; 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89< xe2 x80 x89109 xe2 x80 x89+ xe2 x80 x897; 0 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89k xe2 x80 x89< xe2 x80 x89109 xe2 x80 x89+ xe2 x80 x897). If type xe2 x80 x89= xe2 x80 x892, then next follows integer v (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89v xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) -- the vertex where you need to find the value of the number. For each query of the second type print on a single line the number written in the vertex from the query. Print the number modulo 1000000007 (109 xe2 x80 x89+ xe2 x80 x897). You can read about a rooted tree here: http://en.wikipedia.org/wiki/Tree_(graph_theory).'...

Tutorials

Codeforces Round #232 Editorial (restored)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
63050619 maneatingmonkey C Oct. 21, 2019, 2:04 a.m. OK Clang++17 Diagnostics TESTS 50 1325 88268800
62838894 vjudge5 C Oct. 18, 2019, 1:05 a.m. OK Clang++17 Diagnostics TESTS 50 1949 159129600
62839320 vjudge1 C Oct. 18, 2019, 1:26 a.m. OK Clang++17 Diagnostics TESTS 50 1981 148070400
63050841 maneatingmonkey C Oct. 21, 2019, 2:17 a.m. OK Clang++17 Diagnostics TESTS 50 1996 90419200
6011080 Nik_Storm_2010 C March 13, 2014, 5:08 p.m. OK Delphi TESTS 50 420 18227200
15141800 HappyNewYearMike C Dec. 31, 2015, 9:51 p.m. OK Delphi TESTS 50 717 49459200
5926209 ZeRoGerc C March 4, 2014, 7:14 p.m. OK Delphi TESTS 50 748 49459200
11177716 chenjb C May 20, 2015, 12:48 p.m. OK FPC TESTS 50 826 24780800
5927864 zhzq123 C March 5, 2014, 2:47 a.m. OK FPC TESTS 50 842 16793600
15411250 yinlingfeng C Jan. 17, 2016, 6:21 a.m. OK FPC TESTS 50 857 24064000
5953234 babameme C March 6, 2014, 7:16 p.m. OK FPC TESTS 50 858 22118400
18972771 namjr C July 8, 2016, 4:05 p.m. OK FPC TESTS 50 904 22118400
15411244 vjudge1 C Jan. 17, 2016, 6:20 a.m. OK FPC TESTS 50 904 24064000
15411229 vjudge2 C Jan. 17, 2016, 6:17 a.m. OK FPC TESTS 50 950 24064000
15411457 zhaoxinyi C Jan. 17, 2016, 6:52 a.m. OK FPC TESTS 50 951 32665600
11177180 ez_cjb C May 20, 2015, 12:04 p.m. OK FPC TESTS 50 1029 30003200
6001764 SanSiroWaltz C March 12, 2014, 9:16 a.m. OK FPC TESTS 50 1122 41267200
12116442 sanketM C July 19, 2015, 12:12 p.m. OK GNU C TESTS 50 608 68710400
40989004 ReaLNero1 C July 30, 2018, 10:32 p.m. OK GNU C++ TESTS 50 187 20275200
10525193 Memory120 C March 30, 2015, 1:55 p.m. OK GNU C++ TESTS 50 187 22835200
12289925 anhhung4u C July 31, 2015, 10:04 a.m. OK GNU C++ TESTS 50 202 20275200
40608733 Wuweizheng C July 21, 2018, 12:59 p.m. OK GNU C++ TESTS 50 218 22835200
20676503 King_George C Sept. 17, 2016, 8:31 a.m. OK GNU C++ TESTS 50 249 19251200
10764059 rajat1603 C April 18, 2015, 6:25 a.m. OK GNU C++ TESTS 50 264 28876800
42023557 Scut82 C Aug. 24, 2018, 10:53 a.m. OK GNU C++ TESTS 50 280 25292800
12289855 anhhung4u C July 31, 2015, 9:56 a.m. OK GNU C++ TESTS 50 280 27545600
41426636 luogu_bot5 C Aug. 10, 2018, 9:44 a.m. OK GNU C++ TESTS 50 296 25804800
41426576 luogu_bot4 C Aug. 10, 2018, 9:42 a.m. OK GNU C++ TESTS 50 296 25804800
8219185 adamant C Oct. 13, 2014, 2:17 p.m. OK GNU C++0x TESTS 50 342 39424000
7662967 delta_4d C Sept. 1, 2014, 5:53 p.m. OK GNU C++0x TESTS 50 343 28979200
8620657 Plumrain C Nov. 9, 2014, 7:29 a.m. OK GNU C++0x TESTS 50 343 30208000
5925253 ikatanic C March 4, 2014, 4:32 p.m. OK GNU C++0x TESTS 50 374 25395200
9796855 stefanzzz C Feb. 11, 2015, 9:28 a.m. OK GNU C++0x TESTS 50 405 33689600
7422866 hogloid C Aug. 11, 2014, 3:04 a.m. OK GNU C++0x TESTS 50 420 31436800
6153540 ijkijkijkikjikjkij C March 26, 2014, 7:16 p.m. OK GNU C++0x TESTS 50 420 32256000
8232488 Arterm C Oct. 14, 2014, 11:53 p.m. OK GNU C++0x TESTS 50 421 39219200
6239944 johnathan79717 C April 2, 2014, 8:27 a.m. OK GNU C++0x TESTS 50 436 31436800
6023135 Karoluch C March 16, 2014, 1:31 a.m. OK GNU C++0x TESTS 50 452 44441600
61325618 luogu_bot4 C Sept. 26, 2019, 1:43 p.m. OK GNU C++11 TESTS 50 187 15769600
61325258 luogu_bot3 C Sept. 26, 2019, 1:38 p.m. OK GNU C++11 TESTS 50 187 15769600
45170848 xsc C Nov. 1, 2018, 12:49 p.m. OK GNU C++11 TESTS 50 202 39014400
60335901 Genius_Z C Sept. 10, 2019, 8:32 a.m. OK GNU C++11 TESTS 50 202 147865600
57635473 LuciferX07 C July 24, 2019, 10:34 a.m. OK GNU C++11 TESTS 50 233 21401600
57728641 WCG2025 C July 25, 2019, 7:56 a.m. OK GNU C++11 TESTS 50 233 25804800
57635703 vjudge1 C July 24, 2019, 10:40 a.m. OK GNU C++11 TESTS 50 249 16793600
57637372 koalawy C July 24, 2019, 11:19 a.m. OK GNU C++11 TESTS 50 249 22630400
57636699 luogu_bot2 C July 24, 2019, 11:05 a.m. OK GNU C++11 TESTS 50 249 22630400
57638597 Ganshuaige C July 24, 2019, 11:48 a.m. OK GNU C++11 TESTS 50 249 25804800
27625967 LiChenKoh C June 7, 2017, 5:49 a.m. OK GNU C++14 TESTS 50 218 31436800
47329826 arjitkansal C Dec. 21, 2018, 12:19 p.m. OK GNU C++14 TESTS 50 420 31436800
44528010 vjudge2 C Oct. 19, 2018, 4:33 a.m. OK GNU C++14 TESTS 50 420 32563200
64154658 vjudge5 C Nov. 3, 2019, 12:26 p.m. OK GNU C++14 TESTS 50 421 25395200
31604140 ImaniAm C Oct. 22, 2017, 12:49 p.m. OK GNU C++14 TESTS 50 421 30924800
62171539 PQR-cheater C Oct. 9, 2019, 1:15 a.m. OK GNU C++14 TESTS 50 436 26624000
53541008 vjudge4 C April 30, 2019, 6:44 a.m. OK GNU C++14 TESTS 50 436 30208000
32559912 eidan C Nov. 22, 2017, 7:15 p.m. OK GNU C++14 TESTS 50 451 36249600
46923346 ak532 C Dec. 12, 2018, 6:52 a.m. OK GNU C++14 TESTS 50 452 27648000
46034702 Passenger C Nov. 21, 2018, 3:39 p.m. OK GNU C++14 TESTS 50 482 47001600
57728765 vjudge4 C July 25, 2019, 7:58 a.m. OK GNU C++17 TESTS 50 249 25804800
58334184 Sali_adelkhah C Aug. 5, 2019, 10:47 a.m. OK GNU C++17 TESTS 50 389 28979200
47485487 vjudge3 C Dec. 25, 2018, 8:22 a.m. OK GNU C++17 TESTS 50 389 28979200
48537755 CaNDidaTE_FaSTer C Jan. 18, 2019, 3:06 p.m. OK GNU C++17 TESTS 50 421 29286400
42409299 AryssonFigueiredo C Sept. 2, 2018, 10:29 p.m. OK GNU C++17 TESTS 50 436 28979200
57368627 w0nsh C July 20, 2019, 10:02 a.m. OK GNU C++17 TESTS 50 436 35020800
44925024 am.azadi C Oct. 26, 2018, 7:40 p.m. OK GNU C++17 TESTS 50 436 36454400
67963665 albusdumbledore8918 C Dec. 30, 2019, 12:33 p.m. OK GNU C++17 TESTS 50 451 29081600
57743581 vjudge1 C July 25, 2019, 12:15 p.m. OK GNU C++17 TESTS 50 452 28774400
42143346 The_sound_of_the_fox C Aug. 27, 2018, 7:14 a.m. OK GNU C++17 TESTS 50 452 28979200
69404844 WangJialei C Jan. 23, 2020, 10:27 a.m. OK Go TESTS 50 1903 102707200
5926596 mkirsche C March 4, 2014, 8:38 p.m. OK Java 6 TESTS 50 1294 128307200
10778890 animeshf C April 19, 2015, 8:41 a.m. OK Java 7 TESTS 50 608 183910400
6313953 DoublePointer C April 10, 2014, 5:59 p.m. OK Java 7 TESTS 50 795 71884800
5945133 m.radwan C March 5, 2014, 6:38 p.m. OK Java 7 TESTS 50 919 256512000
6022703 mmaxio C March 15, 2014, 9:53 p.m. OK Java 7 TESTS 50 1528 126668800
10042218 n1tz53 C Feb. 27, 2015, 9:03 a.m. OK Java 8 TESTS 50 670 79769600
10042234 n1tz53 C Feb. 27, 2015, 9:04 a.m. OK Java 8 TESTS 50 701 79769600
68609018 giulietta C Jan. 11, 2020, 3:01 p.m. OK Java 8 TESTS 50 811 177459200
16611057 ian9696 C March 9, 2016, 3:51 a.m. OK Java 8 TESTS 50 872 85196800
59535539 sonusingh.nitaa C Aug. 26, 2019, 4:46 p.m. OK Java 8 TESTS 50 935 101376000
16611047 ian9696 C March 9, 2016, 3:48 a.m. OK Java 8 TESTS 50 951 180736000
25391878 tri C March 11, 2017, 2:35 a.m. OK Java 8 TESTS 50 982 172748800
28935643 AhmedSoliman C July 27, 2017, 5:46 p.m. OK Java 8 TESTS 50 1076 171008000
53471058 A.Khotoolev C April 28, 2019, 12:48 p.m. OK Java 8 TESTS 50 1153 156876800
53441237 A.Khotoolev C April 28, 2019, 12:34 a.m. OK Java 8 TESTS 50 1154 156364800
15901970 bati06 C Feb. 8, 2016, 8:09 p.m. OK MS C# TESTS 50 982 81510400
15902172 bati06 C Feb. 8, 2016, 8:26 p.m. OK MS C# TESTS 50 982 81612800
15901568 bati06 C Feb. 8, 2016, 7:35 p.m. OK MS C# TESTS 50 998 81612800
15901849 bati06 C Feb. 8, 2016, 7:58 p.m. OK MS C# TESTS 50 1169 91238400
15901928 bati06 C Feb. 8, 2016, 8:05 p.m. OK MS C# TESTS 50 1170 91238400
15901918 bati06 C Feb. 8, 2016, 8:04 p.m. OK MS C# TESTS 50 1216 91238400
15901900 bati06 C Feb. 8, 2016, 8:02 p.m. OK MS C# TESTS 50 1466 92569600
5929664 caustique C March 5, 2014, 8:33 a.m. OK MS C++ TESTS 50 374 24064000
57640523 vjudge1 C July 24, 2019, 12:27 p.m. OK MS C++ TESTS 50 389 18022400
5930311 _TMB_ C March 5, 2014, 10:07 a.m. OK MS C++ TESTS 50 389 24064000
49693916 vjudge2 C Feb. 10, 2019, 12:46 p.m. OK MS C++ TESTS 50 436 25292800
57459124 vjudge3 C July 21, 2019, 12:51 p.m. OK MS C++ TESTS 50 436 27648000
57632208 vjudge5 C July 24, 2019, 9:09 a.m. OK MS C++ TESTS 50 436 34816000
57632226 vjudge1 C July 24, 2019, 9:10 a.m. OK MS C++ TESTS 50 452 34816000
6788226 HandIeNeeded C June 3, 2014, 3:20 p.m. OK MS C++ TESTS 50 452 78028800
57645011 vjudge1 C July 24, 2019, 1:58 p.m. OK MS C++ TESTS 50 468 18022400
8602696 shaonianguai C Nov. 7, 2014, 12:34 p.m. OK MS C++ TESTS 50 514 26521600
52034629 aleonov C March 30, 2019, 5:24 p.m. OK MS C++ 2017 TESTS 50 498 21606400
63376267 j3lly5tars C Oct. 25, 2019, 11:07 a.m. OK MS C++ 2017 TESTS 50 841 37273600
63376306 vjudge3 C Oct. 25, 2019, 11:08 a.m. OK MS C++ 2017 TESTS 50 857 37273600
63051664 maneatingmonkey C Oct. 21, 2019, 3:01 a.m. OK MS C++ 2017 TESTS 50 1278 25292800
63051636 maneatingmonkey C Oct. 21, 2019, 3 a.m. OK MS C++ 2017 TESTS 50 1294 25292800
57636471 vjudge5 C July 24, 2019, 11 a.m. OK MS C++ 2017 TESTS 50 1309 68505600
63051533 maneatingmonkey C Oct. 21, 2019, 2:54 a.m. OK MS C++ 2017 TESTS 50 1310 25292800
57636544 vjudge5 C July 24, 2019, 11:01 a.m. OK MS C++ 2017 TESTS 50 1310 63692800
63051420 maneatingmonkey C Oct. 21, 2019, 2:48 a.m. OK MS C++ 2017 TESTS 50 1326 25292800
63051286 maneatingmonkey C Oct. 21, 2019, 2:42 a.m. OK MS C++ 2017 TESTS 50 1356 25292800

remove filters

Back to search problems