Codeforces Round 498 (Div. 3)

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
1006 Codeforces Round 498 (Div. 3) FINISHED False 7200 200071499 July 16, 2018, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9970 ) E Military Problem PROGRAMMING dfs and similar graphs trees 1600

B"In this problem you will have to help Berland army with organizing their command delivery system. There are n officers in Berland army. The first officer is the commander of the army, and he does not have any superiors. Every other officer has exactly one direct superior. If officer a is the direct superior of officer b , then we also can say that officer b is a direct subordinate of officer a . Officer x is considered to be a subordinate (direct or indirect) of officer y if one of the following conditions holds: For example, on the picture below the subordinates of the officer 3 are: 5, 6, 7, 8, 9 . The structure of Berland army is organized in such a way that every officer, except for the commander, is a subordinate of the commander of the army. Formally, let's represent Berland army as a tree consisting of n vertices, in which vertex u corresponds to officer u . The parent of vertex u corresponds to the direct superior of officer u . The root (which has index 1 ) corresponds to the commander of the army. Berland War Ministry has ordered you to give answers on q queries, the i -th query is given as (u_i, k_i) , where u_i is some officer, and k_i is a positive integer. To process the i -th query imagine how a command from u_i spreads to the subordinates of u_i . Typical DFS (depth first search) algorithm is used here. Suppose the current officer is a and he spreads a command. Officer a chooses b -- one of his direct subordinates (i.e. a child in the tree) who has not received this command yet. If there are many such direct subordinates, then a chooses the one having minimal index. Officer a gives a command to officer b . Afterwards, b uses exactly the same algorithm to spread the command to its subtree. After b finishes spreading the command, officer a chooses the next direct "...

Tutorials

60672

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
45652637 starpepe E Nov. 13, 2018, 3:09 a.m. OK Clang++17 Diagnostics TESTS 31 623 67686400 1600
40573967 ruban E July 20, 2018, 10:01 a.m. OK Delphi TESTS 31 155 263270400 1600
40573898 ruban E July 20, 2018, 9:59 a.m. OK Delphi TESTS 31 171 216780800 1600
40938762 __ShaW E July 30, 2018, 7:35 a.m. OK FPC TESTS 31 545 16896000 1600
42346209 TShT E Sept. 1, 2018, 9:38 p.m. OK FPC TESTS 31 561 35225600 1600
40544000 lokianyu E July 19, 2018, 10:30 a.m. OK GNU C TESTS 31 156 12800000 1600
40537021 Asurudo E July 19, 2018, 6:47 a.m. OK GNU C TESTS 31 218 22630400 1600
40694060 weziii E July 24, 2018, 7:13 a.m. OK GNU C++ TESTS 31 93 13619200 1600
40994171 Scut82 E July 31, 2018, 2:32 a.m. OK GNU C++ TESTS 31 124 14438400 1600
40653802 zhtzht E July 23, 2018, 2:02 a.m. OK GNU C++ TESTS 31 124 14438400 1600
40751727 gconeice E July 25, 2018, 6:17 p.m. OK GNU C++ TESTS 31 155 11776000 1600
40496340 gyz_gyz E July 18, 2018, 2:37 a.m. OK GNU C++ TESTS 31 170 30412800 1600
40660828 luogu_bot1 E July 23, 2018, 7:03 a.m. OK GNU C++ TESTS 31 171 12800000 1600
40619245 hehe.xgw E July 21, 2018, 10:16 p.m. OK GNU C++ TESTS 31 186 12595200 1600
41989779 vjudge5 E Aug. 23, 2018, 8:09 a.m. OK GNU C++ TESTS 31 186 14438400 1600
40599967 vjudge2 E July 21, 2018, 7:59 a.m. OK GNU C++ TESTS 31 186 17612800 1600
41993395 vjudge3 E Aug. 23, 2018, 10:25 a.m. OK GNU C++ TESTS 31 187 14438400 1600
41595532 qeatzy E Aug. 14, 2018, 4:37 p.m. OK GNU C++11 TESTS 31 62 15974400 1600
40634127 rprtr258 E July 22, 2018, 11:29 a.m. OK GNU C++11 TESTS 31 62 25702400 1600
66007276 910306264 E Nov. 29, 2019, 11:01 p.m. OK GNU C++11 TESTS 31 78 13312000 1600
44061823 Ilverene E Oct. 10, 2018, 6:26 a.m. OK GNU C++11 TESTS 31 93 11980800 1600
57853957 Frame233 E July 27, 2019, 2:16 p.m. OK GNU C++11 TESTS 31 93 17612800 1600
40995272 jiaangk_ E July 31, 2018, 3:19 a.m. OK GNU C++11 TESTS 31 93 17612800 1600
44773297 ReallyNewBie E Oct. 24, 2018, 1:16 p.m. OK GNU C++11 TESTS 31 93 19251200 1600
40490180 _FariD_ E July 17, 2018, 7:46 p.m. OK GNU C++11 TESTS 31 93 20787200 1600
55522095 Luvwgyx E June 13, 2019, 9:05 a.m. OK GNU C++11 TESTS 31 93 24883200 1600
44061733 luogu_bot1 E Oct. 10, 2018, 6:23 a.m. OK GNU C++11 TESTS 31 108 11980800 1600
50276440 Sonechko E Feb. 21, 2019, 10:17 a.m. OK GNU C++14 TESTS 31 171 14540800 1600
58330335 vipghn2003 E Aug. 5, 2019, 9:09 a.m. OK GNU C++14 TESTS 31 171 14643200 1600
46577795 dvdg6566 E Dec. 4, 2018, 9:38 a.m. OK GNU C++14 TESTS 31 171 14643200 1600
45101639 OrionChocoPie E Oct. 30, 2018, 2:04 p.m. OK GNU C++14 TESTS 31 171 14643200 1600
67676339 shiro53 E Dec. 27, 2019, 2:18 a.m. OK GNU C++14 TESTS 31 171 15360000 1600
50881155 kostia244 E March 6, 2019, 8:57 a.m. OK GNU C++14 TESTS 31 171 15360000 1600
49370396 Arshad12 E Feb. 2, 2019, 5:02 p.m. OK GNU C++14 TESTS 31 171 18022400 1600
49675525 kartikey_21 E Feb. 9, 2019, 7:29 p.m. OK GNU C++14 TESTS 31 171 18329600 1600
64322986 vjudge2 E Nov. 5, 2019, 4:18 p.m. OK GNU C++14 TESTS 31 171 18636800 1600
64322854 WorLone E Nov. 5, 2019, 4:15 p.m. OK GNU C++14 TESTS 31 171 18636800 1600
59697652 DarkAvengerr E Aug. 30, 2019, 9:14 a.m. OK GNU C++17 TESTS 31 171 11366400 1600
61740450 karan2dec E Oct. 2, 2019, 7:58 p.m. OK GNU C++17 TESTS 31 171 14540800 1600
55218471 abraham14 E June 6, 2019, 6:05 p.m. OK GNU C++17 TESTS 31 171 14540800 1600
51911052 kenmRD E March 27, 2019, 6:12 p.m. OK GNU C++17 TESTS 31 171 14540800 1600
62398534 Boy_of_KutBilim E Oct. 12, 2019, 6:29 a.m. OK GNU C++17 TESTS 31 171 14643200 1600
62095098 Priyank E Oct. 8, 2019, 7:13 a.m. OK GNU C++17 TESTS 31 171 15360000 1600
46565494 rt3 E Dec. 3, 2018, 10:24 p.m. OK GNU C++17 TESTS 31 171 15360000 1600
69213927 Nabeel_Ghallawenji E Jan. 20, 2020, 10:05 p.m. OK GNU C++17 TESTS 31 171 15564800 1600
46370967 mblazev E Nov. 29, 2018, 3:46 p.m. OK GNU C++17 TESTS 31 171 17817600 1600
47899992 yuiop8747 E Jan. 4, 2019, 1:29 p.m. OK GNU C++17 TESTS 31 171 18022400 1600
42761096 treasuryonly E Sept. 11, 2018, 10:39 a.m. OK Go TESTS 31 545 27750400 1600
42593275 Marii E Sept. 6, 2018, 9:02 p.m. OK Go TESTS 31 624 48128000 1600
69665939 GiantTornado E Jan. 28, 2020, 11:19 a.m. OK Java 11 TESTS 31 639 156876800 1600
66419155 shubh_jha98 E Dec. 6, 2019, 6:11 p.m. OK Java 11 TESTS 31 1949 232038400 1600
40484649 prathmesh_01 E July 17, 2018, 3:54 p.m. OK Java 8 TESTS 31 311 24473600 1600
40588398 tmp92 E July 20, 2018, 7:45 p.m. OK Java 8 TESTS 31 311 37478400 1600
46643575 kusomushi E Dec. 5, 2018, 11:04 a.m. OK Java 8 TESTS 31 327 15872000 1600
40609025 iamavalon E July 21, 2018, 1:09 p.m. OK Java 8 TESTS 31 327 20787200 1600
55317270 caoash E June 8, 2019, 11:56 p.m. OK Java 8 TESTS 31 327 78540800 1600
64901410 Naeron E Nov. 14, 2019, 7:05 p.m. OK Java 8 TESTS 31 342 51609600 1600
40594130 tusharjape007 E July 21, 2018, 3:35 a.m. OK Java 8 TESTS 31 358 45670400 1600
40928717 prabhat236218 E July 29, 2018, 9:07 p.m. OK Java 8 TESTS 31 358 107622400 1600
50495578 mikkk E Feb. 25, 2019, 3:01 p.m. OK Java 8 TESTS 31 374 68608000 1600
69649364 luchy0120 E Jan. 28, 2020, 4:10 a.m. OK Java 8 TESTS 31 374 69632000 1600
40771498 user32 E July 26, 2018, 8:46 a.m. OK Kotlin TESTS 31 483 59392000 1600
40772273 user32 E July 26, 2018, 9:07 a.m. OK Kotlin TESTS 31 498 69529600 1600
56467002 og.kostya E July 3, 2019, 9:20 a.m. OK Mono C# TESTS 31 296 24268800 1600
41154220 keep.deep E Aug. 3, 2018, 11 a.m. OK Mono C# TESTS 31 374 36352000 1600
41151094 keep.deep E Aug. 3, 2018, 8:55 a.m. OK Mono C# TESTS 31 420 36556800 1600
42362831 TrinidadTobago E Sept. 2, 2018, 12:51 p.m. OK Mono C# TESTS 31 1060 41779200 1600
40557188 Mosyagin E July 19, 2018, 7:13 p.m. OK Mono C# TESTS 31 1746 44032000 1600
50997315 vjudge4 E March 8, 2019, 4:49 a.m. OK MS C++ TESTS 31 140 14438400 1600
42478340 nomiku99 E Sept. 5, 2018, 2:11 a.m. OK MS C++ TESTS 31 140 22630400 1600
48281153 vjudge1 E Jan. 12, 2019, 8:02 a.m. OK MS C++ TESTS 31 140 36044800 1600
58811198 vjudge1 E Aug. 14, 2019, 10:53 a.m. OK MS C++ TESTS 31 155 10444800 1600
43923829 vjudge4 E Oct. 7, 2018, 3:12 a.m. OK MS C++ TESTS 31 171 9625600 1600
41109083 scorpiowf E Aug. 2, 2018, 5:55 a.m. OK MS C++ TESTS 31 171 10649600 1600
48283119 vjudge3 E Jan. 12, 2019, 8:55 a.m. OK MS C++ TESTS 31 171 11161600 1600
55105899 vjudge1 E June 5, 2019, 2:28 a.m. OK MS C++ TESTS 31 171 12083200 1600
66160214 vjudge5 E Dec. 2, 2019, 3:44 a.m. OK MS C++ TESTS 31 171 12902400 1600
55719986 vjudge3 E June 18, 2019, 2:46 p.m. OK MS C++ TESTS 31 171 12902400 1600
58803424 vjudge1 E Aug. 14, 2019, 8:07 a.m. OK MS C++ 2017 TESTS 31 233 10444800 1600
65824945 vjudge3 E Nov. 27, 2019, 12:11 p.m. OK MS C++ 2017 TESTS 31 280 12083200 1600
59089892 pmitkov E Aug. 19, 2019, 12:25 p.m. OK MS C++ 2017 TESTS 31 280 12902400 1600
51656129 Still_Theory E March 21, 2019, 9:42 p.m. OK MS C++ 2017 TESTS 31 592 13721600 1600
59442906 yorky E Aug. 25, 2019, 12:01 p.m. OK MS C++ 2017 TESTS 31 639 16076800 1600
65872477 vjudge3 E Nov. 27, 2019, 4:07 p.m. OK MS C++ 2017 TESTS 31 1201 21606400 1600
64195739 vjudge4 E Nov. 4, 2019, 9:35 a.m. OK MS C++ 2017 TESTS 31 1216 14643200 1600
64195750 Y_is_sunshine E Nov. 4, 2019, 9:36 a.m. OK MS C++ 2017 TESTS 31 1231 14643200 1600
56718539 artem1111 E July 8, 2019, 3:39 p.m. OK MS C++ 2017 TESTS 31 1247 15360000 1600
51875479 AlexandrBusse E March 26, 2019, 7:08 p.m. OK MS C++ 2017 TESTS 31 1247 19251200 1600
40508050 mayakin E July 18, 2018, 9:29 a.m. OK PHP TESTS 31 1248 125644800 1600
43232975 CTC E Sept. 22, 2018, 6:23 a.m. OK PHP TESTS 31 1466 188620800 1600
46468412 noob77777 E Dec. 2, 2018, 5:45 a.m. OK PyPy 2 TESTS 31 950 79257600 1600
40588782 JJF E July 20, 2018, 8:08 p.m. OK PyPy 3 TESTS 31 1809 43622400 1600
42217206 fascineted E Aug. 28, 2018, 5:55 p.m. OK PyPy 3 TESTS 31 2058 41984000 1600
62329535 deadguy E Oct. 10, 2019, 7:59 p.m. OK PyPy 3 TESTS 31 2105 62259200 1600
53879832 yfo E May 8, 2019, 2:02 p.m. OK PyPy 3 TESTS 31 2823 38297600 1600
47535142 TurningTables E Dec. 27, 2018, 12:08 a.m. OK PyPy 3 TESTS 31 2979 50585600 1600
55086643 shubhankarsharma00 E June 4, 2019, 12:49 p.m. OK Python 2 TESTS 31 1481 57753600 1600
43593140 SerChirag E Sept. 30, 2018, 4:46 a.m. OK Python 2 TESTS 31 1497 197632000 1600
40602241 vjudge1 E July 21, 2018, 9:15 a.m. OK Python 2 TESTS 31 1809 39936000 1600
40484477 inishchith. E July 17, 2018, 3:49 p.m. OK Python 2 TESTS 31 1918 239001600 1600
41563158 scottaran9 E Aug. 13, 2018, 3:44 p.m. OK Python 2 TESTS 31 2074 239104000 1600
40751711 kl738 E July 25, 2018, 6:16 p.m. OK Python 3 TESTS 31 1591 40755200 1600
40868267 hungry_fool E July 28, 2018, 4:59 a.m. OK Python 3 TESTS 31 1668 43622400 1600
65465872 kopok2 E Nov. 21, 2019, 5:51 a.m. OK Python 3 TESTS 31 1809 70144000 1600
40586803 calvin.wunderkind E July 20, 2018, 6:16 p.m. OK Python 3 TESTS 31 2027 31846400 1600
40546093 peterandluc E July 19, 2018, 11:50 a.m. OK Python 3 TESTS 31 2542 47718400 1600
40588724 Droche E July 20, 2018, 8:04 p.m. OK Python 3 TESTS 31 2948 49459200 1600
40545342 vain0 E July 19, 2018, 11:21 a.m. OK Rust TESTS 31 1309 13312000 1600
46409653 yakamoto E Nov. 30, 2018, 4:25 p.m. OK Scala TESTS 31 639 12800000 1600
42902326 gazaan E Sept. 15, 2018, 8:01 p.m. OK Scala TESTS 31 2963 168140800 1600
42936172 gazaan E Sept. 16, 2018, 11:38 a.m. OK Scala TESTS 31 2963 206233600 1600

remove filters

Back to search problems