Codeforces Round 912 (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
1903 Codeforces Round 912 (Div. 2) FINISHED False 8100 35817863 Nov. 30, 2023, 4:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 675 ) F Babysitting PROGRAMMING 2-sat binary search data structures graphs

B'Theofanis wants to play video games, however he should also take care of his sister. Since Theofanis is a CS major, he found a way to do both. He will install some cameras in his house in order to make sure his sister is okay. His house is an undirected graph with n nodes and m edges. His sister likes to play at the edges of the graph, so he has to install a camera to at least one endpoint of every edge of the graph. Theofanis wants to find a vertex cover that maximizes the minimum difference between indices of the chosen nodes. More formally, let a_1, a_2, ldots, a_k be a vertex cover of the graph. Let the minimum difference between indices of the chosen nodes be the minimum lvert a_i - a_j rvert (where i neq j ) out of the nodes that you chose. If k = 1 then we assume that the minimum difference between indices of the chosen nodes is n . Can you find the maximum possible minimum difference between indices of the chosen nodes over all vertex covers? The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n and m ( 1 <= n <= 10^{5}, 1 <= m <= 2 cdot 10^{5} ) -- the number of nodes and the number of edges. The i -th of the following m lines in the test case contains two positive integers u_i and v_i ( 1 <= u_i,v_i <= n ), meaning that there exists an edge between them in the graph. It is guaranteed that the sum of n over all test cases does not exceed 10^{5} . It is guaranteed that the sum of m over all test cases does not exceed 2 cdot 10^{5} . For each test case, print the maximum minimum difference between indices of the chosen nodes over all vertex covers. In the first test case, we can install cameras at nodes 1 , 3 , and 7 , so the answer is 2 . In the second test case, we can install only one camera at node $'...

Tutorials

Codeforces Round #912 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
235157384 zltzlt F Dec. 1, 2023, 2:22 a.m. OK GNU C++14 TESTS 55 1699 126668800
235127232 StarSilk F Nov. 30, 2023, 6:38 p.m. OK GNU C++14 TESTS 54 1778 40652800
235128650 RUSH_D_CAT F Nov. 30, 2023, 6:43 p.m. OK GNU C++17 TESTS 54 1699 248524800
235146171 aditi062519 F Nov. 30, 2023, 9:54 p.m. OK GNU C++17 TESTS 55 1886 40960000
235141771 aditi062519 F Nov. 30, 2023, 8:46 p.m. OK GNU C++17 TESTS 54 1980 76492800
235128636 foammm F Nov. 30, 2023, 6:43 p.m. OK GNU C++17 TESTS 54 1996 70656000
235124166 Puranya_ F Nov. 30, 2023, 6:26 p.m. OK GNU C++17 TESTS 54 2183 5939200
235137299 Devil F Nov. 30, 2023, 7:58 p.m. OK GNU C++17 TESTS 54 2417 76595200
235117022 peti1234 F Nov. 30, 2023, 6 p.m. OK GNU C++17 TESTS 54 2479 78336000
235148334 Nickir F Nov. 30, 2023, 10:43 p.m. OK GNU C++17 TESTS 55 3197 73216000
235124718 Top2Greece F Nov. 30, 2023, 6:28 p.m. OK GNU C++17 TESTS 54 4242 103833600
235136796 Devil F Nov. 30, 2023, 7:53 p.m. OK GNU C++17 TESTS 54 4383 76697600
235126382 zhouyuheng2009 F Nov. 30, 2023, 6:34 p.m. OK GNU C++17 (64) TESTS 54 1840 67379200
235172472 IceKnight1093 F Dec. 1, 2023, 5:51 a.m. OK GNU C++17 (64) TESTS 55 2105 60723200
235151373 MarcosK F Dec. 1, 2023, 12:07 a.m. OK GNU C++17 (64) TESTS 55 3712 114585600
235149307 ikuyo_kita F Nov. 30, 2023, 11:08 p.m. OK GNU C++17 (64) TESTS 55 4086 144998400
235150272 ikuyo_kita F Nov. 30, 2023, 11:36 p.m. OK GNU C++17 (64) TESTS 55 4913 144998400
235159208 Roundgod F Dec. 1, 2023, 2:54 a.m. OK GNU C++17 (64) TESTS 55 5381 190361600
235124650 rniya F Nov. 30, 2023, 6:28 p.m. OK GNU C++17 (64) TESTS 54 6707 93696000
235166051 ganeid F Dec. 1, 2023, 4:38 a.m. OK GNU C++20 (64) TESTS 55 1044 34713600
235165368 ganeid F Dec. 1, 2023, 4:28 a.m. OK GNU C++20 (64) TESTS 55 1154 45977600
235160848 ganeid F Dec. 1, 2023, 3:20 a.m. OK GNU C++20 (64) TESTS 55 1169 45977600
235119835 maspy F Nov. 30, 2023, 6:10 p.m. OK GNU C++20 (64) TESTS 54 1294 27238400
235156746 taiwanguo F Dec. 1, 2023, 2:10 a.m. OK GNU C++20 (64) TESTS 55 1357 96665600
235157619 rqoi031 F Dec. 1, 2023, 2:27 a.m. OK GNU C++20 (64) TESTS 55 1403 201830400
235120611 SSerxhs F Nov. 30, 2023, 6:13 p.m. OK GNU C++20 (64) TESTS 54 1497 76185600
235157819 rqoi031 F Dec. 1, 2023, 2:30 a.m. OK GNU C++20 (64) TESTS 55 1497 105676800
235159663 NKheyuxiang F Dec. 1, 2023, 3:02 a.m. OK GNU C++20 (64) TESTS 55 1793 75980800
235155041 --quark404 F Dec. 1, 2023, 1:32 a.m. OK GNU C++20 (64) TESTS 55 1808 150835200

remove filters

Back to search problems