Codeforces Round 782 (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
1659 Codeforces Round 782 (Div. 2) FINISHED False 8100 81617099 April 17, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1605 ) E AND-MEX Walk PROGRAMMING bitmasks brute force data structures dfs and similar ds graphs greedy

B'There is an undirected, connected graph with n vertices and m weighted edges. A walk from vertex u to vertex v is defined as a sequence of vertices p_1,p_2, ldots,p_k (which are not necessarily distinct) starting with u and ending with v , such that p_i and p_{i+1} are connected by an edge for 1 <= q i < k . We define the length of a walk as follows: take the ordered sequence of edges and write down the weights on each of them in an array. Now, write down the bitwise AND of every nonempty prefix of this array. The length of the walk is the MEX of all these values. More formally, let us have [w_1,w_2, ldots,w_{k-1}] where w_i is the weight of the edge between p_i and p_{i+1} . Then the length of the walk is given by mathrm{MEX}( {w_1, ,w_1 & w_2, , ldots, ,w_1 & w_2 & ldots & w_{k-1} }) , where & denotes the bitwise AND operation. Now you must process q queries of the form u v. For each query, find the minimum possible length of a walk from u to v . The MEX (minimum excluded) of a set is the smallest non-negative integer that does not belong to the set. For instance: The first line contains two integers n and m ( 2 <= q n <= q 10^5 ; n-1 <= q m <= q min{ <= ft( frac{n(n-1)}{2},10^5 right)} ). Each of the next m lines contains three integers a , b , and w ( 1 <= q a, b <= q n , a neq b ; 0 <= q w < 2^{30} ) indicating an undirected edge between vertex a and vertex b with weight w . The input will not contain self-loops or duplicate edges, and the provided graph will be connected. The next line contains a single integer q ( 1 <= q q <= q 10^5 ). Each of the next q lines contains two integers u and v ( 1 <= q u, v <= q n , u neq v ), the description of each query. For each query, print one line containing a single integer -- the answer '...

Tutorials

Codeforces Round #782 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
153929339 Clock_Paradox E April 17, 2022, 4:12 p.m. OK FPC TESTS 22 1513 104755200
153962602 chro4896 E April 18, 2022, 2:36 a.m. OK GNU C11 TESTS 22 811 45158400
153931458 yuziriha E April 17, 2022, 4:20 p.m. OK GNU C++14 TESTS 22 249 4403200
153967854 HpSuda E April 18, 2022, 4:43 a.m. OK GNU C++14 TESTS 22 249 49971200
153939955 CoachDanke E April 17, 2022, 5:20 p.m. OK GNU C++14 TESTS 22 296 16384000
153943423 Write_Hape_Code E April 17, 2022, 6:02 p.m. OK GNU C++14 TESTS 22 343 16896000
153934352 pasa3232 E April 17, 2022, 4:32 p.m. OK GNU C++14 TESTS 22 343 33689600
153940250 cunzai_zsy0531 E April 17, 2022, 5:22 p.m. OK GNU C++14 TESTS 22 421 18841600
153932134 xing89qs E April 17, 2022, 4:23 p.m. OK GNU C++14 TESTS 22 436 9625600
153963385 XG0000 E April 18, 2022, 2:57 a.m. OK GNU C++14 TESTS 22 451 15155200
153962106 cp152 E April 18, 2022, 2:20 a.m. OK GNU C++14 TESTS 22 452 17715200
153930833 devans E April 17, 2022, 4:17 p.m. OK GNU C++14 TESTS 22 468 45056000
153936232 rt3 E April 17, 2022, 4:40 p.m. OK GNU C++17 TESTS 22 265 3788800
153942981 timg8710 E April 17, 2022, 5:56 p.m. OK GNU C++17 TESTS 22 280 6656000
153938618 NULL0x7f E April 17, 2022, 4:49 p.m. OK GNU C++17 TESTS 22 327 3686400
153931125 praying_cqf E April 17, 2022, 4:18 p.m. OK GNU C++17 TESTS 22 343 4096000
153929456 _LeMur_ E April 17, 2022, 4:12 p.m. OK GNU C++17 TESTS 22 343 50073600
153934208 123hei E April 17, 2022, 4:32 p.m. OK GNU C++17 TESTS 22 358 7475200
153941661 1459007298 E April 17, 2022, 5:38 p.m. OK GNU C++17 TESTS 22 373 51404800
153961154 newhar E April 18, 2022, 1:50 a.m. OK GNU C++17 TESTS 22 389 3174400
153937808 Bobrosoft E April 17, 2022, 4:47 p.m. OK GNU C++17 TESTS 22 389 55603200
153937395 khiro E April 17, 2022, 4:45 p.m. OK GNU C++17 TESTS 22 389 63180800
153948351 Valera_Grinenko E April 17, 2022, 7:32 p.m. OK GNU C++17 (64) TESTS 22 202 3584000
153925550 ei133333 E April 17, 2022, 3:57 p.m. OK GNU C++17 (64) TESTS 22 234 2867200
153929319 HCPS42 E April 17, 2022, 4:11 p.m. OK GNU C++17 (64) TESTS 22 265 5632000
153962968 cjoa E April 18, 2022, 2:46 a.m. OK GNU C++17 (64) TESTS 22 280 26931200
153928617 haruki_K E April 17, 2022, 4:09 p.m. OK GNU C++17 (64) TESTS 22 358 29696000
153932518 Hyperbolic E April 17, 2022, 4:24 p.m. OK GNU C++17 (64) TESTS 22 374 38502400
153940122 KevinWan E April 17, 2022, 5:21 p.m. OK GNU C++17 (64) TESTS 22 451 25804800
153938483 Richelieu E April 17, 2022, 4:49 p.m. OK GNU C++17 (64) TESTS 22 499 29696000
153944210 Hyado E April 17, 2022, 6:15 p.m. OK GNU C++17 (64) TESTS 22 514 10547200
153945939 dimss E April 17, 2022, 6:46 p.m. OK GNU C++17 (64) TESTS 22 561 31027200
153948413 Valera_Grinenko E April 17, 2022, 7:34 p.m. OK GNU C++20 (64) TESTS 22 202 3584000
153948423 Valera_Grinenko E April 17, 2022, 7:34 p.m. OK GNU C++20 (64) TESTS 22 202 3584000
153964871 HYLTianMeng E April 18, 2022, 3:36 a.m. OK GNU C++20 (64) TESTS 22 249 16691200
153924445 ytkn E April 17, 2022, 3:53 p.m. OK GNU C++20 (64) TESTS 22 265 2867200
153937537 DipanshuG E April 17, 2022, 4:46 p.m. OK GNU C++20 (64) TESTS 22 295 19251200
153942014 Rubikun E April 17, 2022, 5:43 p.m. OK GNU C++20 (64) TESTS 22 311 25292800
153942357 Rubikun E April 17, 2022, 5:47 p.m. OK GNU C++20 (64) TESTS 22 311 26521600
153936007 wjli E April 17, 2022, 4:39 p.m. OK GNU C++20 (64) TESTS 22 327 58470400
153953580 new_acc E April 17, 2022, 9:26 p.m. OK GNU C++20 (64) TESTS 22 358 70246400
153942904 Rubikun E April 17, 2022, 5:54 p.m. OK GNU C++20 (64) TESTS 22 373 74854400
153935524 iakovlev.zakhar E April 17, 2022, 4:37 p.m. OK Java 8 TESTS 22 623 39424000
153940150 MagentaCobra E April 17, 2022, 5:22 p.m. OK Java 8 TESTS 22 764 30003200
153948427 golions E April 17, 2022, 7:34 p.m. OK Java 8 TESTS 22 1746 55808000
153929355 arvindf232 E April 17, 2022, 4:12 p.m. OK Kotlin 1.4 TESTS 22 889 39526400
153924121 machine_solution E April 17, 2022, 3:52 p.m. OK MS C++ 2017 TESTS 22 1262 74956800
153951139 KseniaShk E April 17, 2022, 8:31 p.m. OK MS C++ 2017 TESTS 22 2199 146841600
153940120 eepsilon E April 17, 2022, 5:21 p.m. OK PyPy 3 TESTS 22 2464 49049600
153938128 misorin E April 17, 2022, 4:48 p.m. OK PyPy 3 TESTS 22 2651 58163200
153931964 SPD_9X2 E April 17, 2022, 4:22 p.m. OK PyPy 3 TESTS 22 2995 58675200
153943638 conqueror_of_tourist E April 17, 2022, 6:06 p.m. OK PyPy 3-64 TESTS 22 2121 103526400
153943619 huikang E April 17, 2022, 6:06 p.m. OK PyPy 3-64 TESTS 22 2355 131174400

remove filters

Back to search problems