Codeforces Global Round 17

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
1610 Codeforces Global Round 17 FINISHED False 10800 99501863 Nov. 23, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 549 ) F Mashtali: a Space Oddysey PROGRAMMING constructive algorithms dfs and similar graphs implementation

B"Lee was planning to get closer to Mashtali's heart to proceed with his evil plan(which we're not aware of, yet), so he decided to beautify Mashtali's graph. But he made several rules for himself. And also he was too busy with his plans that he didn't have time for such minor tasks, so he asked you for help. Mashtali's graph is an undirected weighted graph with n vertices and m edges with weights equal to either 1 or 2 . Lee wants to direct the edges of Mashtali's graph so that it will be as beautiful as possible. Lee thinks that the beauty of a directed weighted graph is equal to the number of its Oddysey vertices. A vertex v is an Oddysey vertex if |d^+(v) - d^-(v)| = 1 , where d^+(v) is the sum of weights of the outgoing from v edges, and d^-(v) is the sum of the weights of the incoming to v edges. Find the largest possible beauty of a graph that Lee can achieve by directing the edges of Mashtali's graph. In addition, find any way to achieve it. Note that you have to orient each edge. The first line contains two integers n and m (1 <= n <= 10^5; ; 1 <= m <= 10^5) -- the numbers of vertices and edges in the graph. The i -th line of the following m lines contains three integers u_i , v_i and w_i ( 1 <= u_i , v_i <= n; ; u_i neq v_i; ; bf{w_i in {1, 2 }} ) -- the endpoints of the i -th edge and its weight. Note that the graph doesn't have to be connected, and it might contain multiple edges. In the first line print a single integer -- the maximum beauty of the graph Lee can achieve. In the second line print a string of length m consisting of 1 s and 2 s -- directions of the edges. If you decide to direct the i -th edge from vertex u_i to vertex v_i , i -th character of the string should be 1 . Otherwise, it should be 2 . Explanation for the first sample: Explanation for the third "...

Tutorials

Codeforces Global Round 17 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
136688078 hos.lyric F Nov. 23, 2021, 7:50 p.m. OK D TESTS 38 217 45772800
136680254 Mr_Wu F Nov. 23, 2021, 5:50 p.m. OK GNU C++14 TESTS 38 78 18534400
136700909 liuxiang F Nov. 24, 2021, 3:29 a.m. OK GNU C++14 TESTS 40 93 38502400
136671359 happyguy656 F Nov. 23, 2021, 4:49 p.m. OK GNU C++14 TESTS 38 109 91955200
136700695 Suiseiseki F Nov. 24, 2021, 3:23 a.m. OK GNU C++14 TESTS 40 124 37785600
136667041 Karry5307_AK_NOI2021 F Nov. 23, 2021, 4:27 p.m. OK GNU C++14 TESTS 38 124 52326400
136700856 TiwAirOAO F Nov. 24, 2021, 3:27 a.m. OK GNU C++14 TESTS 40 140 56832000
136672270 dlalswp25 F Nov. 23, 2021, 4:54 p.m. OK GNU C++14 TESTS 38 155 33587200
136661057 Radewoosh F Nov. 23, 2021, 4:02 p.m. OK GNU C++14 TESTS 38 171 24166400
136675319 shb F Nov. 23, 2021, 5:12 p.m. OK GNU C++14 TESTS 38 202 33280000
136669304 SkyCrystal F Nov. 23, 2021, 4:38 p.m. OK GNU C++14 TESTS 38 202 99942400
136693335 Wailydest F Nov. 23, 2021, 10:35 p.m. OK GNU C++17 TESTS 38 78 8396800
136707928 Hartley F Nov. 24, 2021, 5:49 a.m. OK GNU C++17 TESTS 40 93 17203200
136672590 nxa_k_o F Nov. 23, 2021, 4:56 p.m. OK GNU C++17 TESTS 38 93 64204800
136662009 SpyCheese F Nov. 23, 2021, 4:06 p.m. OK GNU C++17 TESTS 38 109 7987200
136678137 inaFSTream F Nov. 23, 2021, 5:29 p.m. OK GNU C++17 TESTS 38 109 38809600
136662127 Subconscious F Nov. 23, 2021, 4:06 p.m. OK GNU C++17 TESTS 38 109 70246400
136667948 hank55663 F Nov. 23, 2021, 4:32 p.m. OK GNU C++17 TESTS 38 124 23449600
136699659 djq_cpp F Nov. 24, 2021, 2:57 a.m. OK GNU C++17 TESTS 40 140 41267200
136673448 K_T_O F Nov. 23, 2021, 5:01 p.m. OK GNU C++17 TESTS 38 140 197734400
136688829 om_13 F Nov. 23, 2021, 8:05 p.m. OK GNU C++17 TESTS 38 155 10035200
136671763 tourist F Nov. 23, 2021, 4:51 p.m. OK GNU C++17 (64) TESTS 38 124 13824000
136686427 tabr F Nov. 23, 2021, 7:17 p.m. OK GNU C++17 (64) TESTS 38 124 13926400
136682540 kotatsugame F Nov. 23, 2021, 6:15 p.m. OK GNU C++17 (64) TESTS 38 139 35942400
136673099 hanbyeol_ F Nov. 23, 2021, 4:59 p.m. OK GNU C++17 (64) TESTS 38 140 15872000
136669836 natsugiri F Nov. 23, 2021, 4:41 p.m. OK GNU C++17 (64) TESTS 38 140 33792000
136673305 tute7627 F Nov. 23, 2021, 5 p.m. OK GNU C++17 (64) TESTS 38 155 29081600
136670510 lumibons F Nov. 23, 2021, 4:44 p.m. OK GNU C++17 (64) TESTS 38 155 32768000
136681294 kostia244 F Nov. 23, 2021, 5:59 p.m. OK GNU C++17 (64) TESTS 38 155 62259200
136698094 DreamingLeaf F Nov. 24, 2021, 2:10 a.m. OK GNU C++17 (64) TESTS 38 156 16896000
136685847 icecuber F Nov. 23, 2021, 7:06 p.m. OK GNU C++17 (64) TESTS 38 156 17305600
136700758 RiverHamster F Nov. 24, 2021, 3:25 a.m. OK GNU C++20 (64) TESTS 40 93 31948800
136707042 frame233 F Nov. 24, 2021, 5:35 a.m. OK GNU C++20 (64) TESTS 40 93 71372800
136678767 flashmt F Nov. 23, 2021, 5:32 p.m. OK GNU C++20 (64) TESTS 38 108 16384000
136682572 clyring F Nov. 23, 2021, 6:15 p.m. OK GNU C++20 (64) TESTS 38 109 13312000
136682322 clyring F Nov. 23, 2021, 6:12 p.m. OK GNU C++20 (64) TESTS 38 109 13312000
136672668 l1ll5 F Nov. 23, 2021, 4:56 p.m. OK GNU C++20 (64) TESTS 38 109 148070400
136698295 wasa855 F Nov. 24, 2021, 2:17 a.m. OK GNU C++20 (64) TESTS 40 124 43212800
136705085 Alan233 F Nov. 24, 2021, 5 a.m. OK GNU C++20 (64) TESTS 40 124 64204800
136704772 Alan233 F Nov. 24, 2021, 4:55 a.m. OK GNU C++20 (64) TESTS 40 124 66560000
136700150 syl123456 F Nov. 24, 2021, 3:09 a.m. OK GNU C++20 (64) TESTS 40 139 15052800
136686874 arvindf232 F Nov. 23, 2021, 7:26 p.m. OK Kotlin 1.4 TESTS 38 374 22220800
136676407 arvindf232 F Nov. 23, 2021, 5:19 p.m. OK Kotlin 1.4 TESTS 38 420 20992000
136686773 arvindf232 F Nov. 23, 2021, 7:24 p.m. OK Kotlin 1.4 TESTS 38 436 20992000
136667884 conqueror_of_tourist F Nov. 23, 2021, 4:31 p.m. OK PyPy 3-64 TESTS 38 779 56217600

remove filters

Back to search problems