Educational Codeforces Round 106 (Rated for 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
1499 Educational Codeforces Round 106 (Rated for Div. 2) FINISHED False 7200 121273811 March 18, 2021, 2:50 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 198 ) G Graph Coloring PROGRAMMING data structures graphs interactive

B"You are given a bipartite graph consisting of n_1 vertices in the first part, n_2 vertices in the second part, and m edges, numbered from 1 to m . You have to color each edge into one of two colors, red and blue. You have to minimize the following value: sum limits_{v in V} |r(v) - b(v)| , where V is the set of vertices of the graph, r(v) is the number of red edges incident to v , and b(v) is the number of blue edges incident to v . Sounds classical and easy, right? Well, you have to process q queries of the following format: Note that if an edge was red or blue in some coloring, it may change its color in next colorings. The hash of the coloring is calculated as follows: let R be the set of indices of red edges, then the hash is ( sum limits_{i in R} 2^i) bmod 998244353 . Note that you should solve the problem in online mode. It means that you can't read the whole input at once. You can read each query only after writing the answer for the last query. Use functions fflush in C++ and BufferedWriter.flush in Java languages after each writing in your program. The first line contains three integers n_1 , n_2 and m ( 1 <= n_1, n_2, m <= 2 cdot 10^5 ). Then m lines follow, the i -th of them contains two integers x_i and y_i ( 1 <= x_i <= n_1 ; 1 <= y_i <= n_2 ) meaning that the i -th edge connects the vertex x_i from the first part and the vertex y_i from the second part. The next line contains one integer q ( 1 <= q <= 2 cdot 10^5 ) -- the number of queries you have to process. The next q lines contain the queries in the format introduced in the statement. Additional constraints on the input: To answer a query of type 1 , print one integer -- the hash of the optimal coloring. To answer a query of type 2 , print one line. It should begin with the integer k -- th"...

Tutorials

Educational Codeforces Round 106 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
110394450 atoiz G March 18, 2021, 6:14 p.m. OK GNU C++11 TESTS 23 1497 15974400
110411112 q-w-q-w-q G March 19, 2021, 2:47 a.m. OK GNU C++11 TESTS 23 1606 10444800
110394493 atoiz G March 18, 2021, 6:15 p.m. OK GNU C++11 TESTS 23 3587 15974400
110394179 atoiz G March 18, 2021, 6:10 p.m. OK GNU C++11 TESTS 23 3634 15974400
110386520 KrK G March 18, 2021, 4:52 p.m. OK GNU C++17 TESTS 23 2152 19251200
110388825 natsugiri G March 18, 2021, 5:08 p.m. OK GNU C++17 TESTS 23 2308 52838400
110394187 2018.aditya.sawant G March 18, 2021, 6:10 p.m. OK GNU C++17 TESTS 23 2495 74342400
110408094 cjtoribio G March 19, 2021, 12:50 a.m. OK GNU C++17 TESTS 23 2683 23449600
110389305 Shady49 G March 18, 2021, 5:12 p.m. OK GNU C++17 TESTS 23 2729 71987200
110397395 rainboy G March 18, 2021, 6:58 p.m. OK GNU C++17 (64) TESTS 23 1887 9932800
110399893 tute7627 G March 18, 2021, 7:45 p.m. OK GNU C++17 (64) TESTS 23 2012 164249600
110381143 neal G March 18, 2021, 4:37 p.m. OK GNU C++17 (64) TESTS 23 2527 110387200
110383352 neal G March 18, 2021, 4:43 p.m. OK GNU C++17 (64) TESTS 23 2604 110796800
110385398 neal G March 18, 2021, 4:48 p.m. OK GNU C++17 (64) TESTS 23 2620 112742400
110384002 neal G March 18, 2021, 4:45 p.m. OK GNU C++17 (64) TESTS 23 2683 110796800
110399277 kotatsugame G March 18, 2021, 7:33 p.m. OK GNU C++17 (64) TESTS 23 2698 18227200
110382778 neal G March 18, 2021, 4:42 p.m. OK GNU C++17 (64) TESTS 23 2729 110796800
110382230 neal G March 18, 2021, 4:40 p.m. OK GNU C++17 (64) TESTS 23 2916 110796800
110399201 sansen G March 18, 2021, 7:31 p.m. OK Rust TESTS 23 4554 38297600

remove filters

Back to search problems