Codeforces Round 813 (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
1712 Codeforces Round 813 (Div. 2) FINISHED False 8100 71421899 Aug. 13, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4568 ) D Empty Graph PROGRAMMING binary search data structures greedy

B'An array of n positive integers a_1,a_2, ldots,a_n fell down on you from the skies, along with a positive integer k <= n . You can apply the following operation at most k times: Then build a complete undirected weighted graph with n vertices numbered with integers from 1 to n , where edge (l, r) ( 1 <= l < r <= n ) has weight min(a_{l},a_{l+1}, ldots,a_{r}) . You have to find the maximum possible diameter of the resulting graph after performing at most k operations. The diameter of a graph is equal to max limits_{1 <= u < v <= n}{ operatorname{d}(u, v)} , where operatorname{d}(u, v) is the length of the shortest path between vertex u and vertex v . Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 10^4 ). Description of the test cases follows. The first line of each test case contains two integers n and k ( 2 <= n <= 10^5 , 1 <= k <= n ). The second line of each test case contains n positive integers a_1,a_2, ldots,a_n ( 1 <= a_i <= 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case print one integer -- the maximum possible diameter of the graph after performing at most k operations. In the first test case, one of the optimal arrays is [2,4,5] . The graph built on this array: operatorname{d}(1, 2) = operatorname{d}(1, 3) = 2 and operatorname{d}(2, 3) = 4 , so the diameter is equal to max(2,2,4) = 4 . '...

Tutorials

Codeforces Round #813 (Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
168226412 Tdyx D Aug. 14, 2022, 5:30 a.m. OK C# 8 TESTS 54 187 24576000
168218392 xsdjg D Aug. 14, 2022, 3:07 a.m. OK GNU C++14 TESTS 54 31 1638400
168225986 yhk1001 D Aug. 14, 2022, 5:24 a.m. OK GNU C++14 TESTS 54 46 409600
168214584 alkido D Aug. 14, 2022, 1:47 a.m. OK GNU C++14 TESTS 54 46 409600
168214489 alkido D Aug. 14, 2022, 1:45 a.m. OK GNU C++14 TESTS 54 46 409600
168218018 GJC_xj D Aug. 14, 2022, 3 a.m. OK GNU C++14 TESTS 54 46 819200
168216701 Calanosay D Aug. 14, 2022, 2:30 a.m. OK GNU C++14 TESTS 54 46 819200
168216646 Calanosay D Aug. 14, 2022, 2:29 a.m. OK GNU C++14 TESTS 54 46 819200
168216115 __TRY_ D Aug. 14, 2022, 2:18 a.m. OK GNU C++14 TESTS 54 46 819200
168216022 juruo_c D Aug. 14, 2022, 2:17 a.m. OK GNU C++14 TESTS 54 46 819200
168215573 KKIOO D Aug. 14, 2022, 2:07 a.m. OK GNU C++14 TESTS 54 46 819200
168182038 Bobocan D Aug. 13, 2022, 5:35 p.m. OK GNU C++17 TESTS 54 31 1331200
168174463 G_LX D Aug. 13, 2022, 4:39 p.m. OK GNU C++17 TESTS 54 31 3276800
168215035 zhuoli D Aug. 14, 2022, 1:56 a.m. OK GNU C++17 TESTS 54 46 409600
168172534 shalekberli D Aug. 13, 2022, 4:33 p.m. OK GNU C++17 TESTS 54 46 409600
168228511 lequangtrung123 D Aug. 14, 2022, 5:59 a.m. OK GNU C++17 TESTS 54 46 819200
168220331 Redcrown D Aug. 14, 2022, 3:44 a.m. OK GNU C++17 TESTS 54 46 819200
168219092 TwOKAr D Aug. 14, 2022, 3:21 a.m. OK GNU C++17 TESTS 54 46 819200
168218737 dargoncat D Aug. 14, 2022, 3:14 a.m. OK GNU C++17 TESTS 54 46 819200
168216434 c____c D Aug. 14, 2022, 2:25 a.m. OK GNU C++17 TESTS 54 46 819200
168215080 S_ky D Aug. 14, 2022, 1:57 a.m. OK GNU C++17 TESTS 54 46 819200
168222339 zhangshaojia D Aug. 14, 2022, 4:22 a.m. OK GNU C++17 (64) TESTS 54 30 2867200
168187445 Beevo D Aug. 13, 2022, 6:12 p.m. OK GNU C++17 (64) TESTS 54 31 819200
168184297 BLUE_6 D Aug. 13, 2022, 5:49 p.m. OK GNU C++17 (64) TESTS 54 31 819200
168221279 Artemis_Bow D Aug. 14, 2022, 4:03 a.m. OK GNU C++17 (64) TESTS 54 46 819200
168215942 Siesta. D Aug. 14, 2022, 2:15 a.m. OK GNU C++17 (64) TESTS 54 46 819200
168214079 Kenshin2438 D Aug. 14, 2022, 1:34 a.m. OK GNU C++17 (64) TESTS 54 46 819200
168213533 Kenshin2438 D Aug. 14, 2022, 1:22 a.m. OK GNU C++17 (64) TESTS 54 46 819200
168191720 KevinyWu D Aug. 13, 2022, 6:48 p.m. OK GNU C++17 (64) TESTS 54 46 819200
168189019 OnMyZenith D Aug. 13, 2022, 6:24 p.m. OK GNU C++17 (64) TESTS 54 46 819200
168187438 jo_on D Aug. 13, 2022, 6:12 p.m. OK GNU C++17 (64) TESTS 54 46 819200
168217562 beyond271828 D Aug. 14, 2022, 2:49 a.m. OK GNU C++20 (64) TESTS 54 31 409600
168197052 Aditya-Bk D Aug. 13, 2022, 7:42 p.m. OK GNU C++20 (64) TESTS 54 31 409600
168209688 etherinmatic D Aug. 13, 2022, 11:32 p.m. OK GNU C++20 (64) TESTS 54 31 819200
168189434 v0s7er D Aug. 13, 2022, 6:27 p.m. OK GNU C++20 (64) TESTS 54 31 819200
168184823 foammm D Aug. 13, 2022, 5:53 p.m. OK GNU C++20 (64) TESTS 54 31 1228800
168184473 tiom4eg D Aug. 13, 2022, 5:50 p.m. OK GNU C++20 (64) TESTS 54 31 1228800
168173054 aggressor_ D Aug. 13, 2022, 4:35 p.m. OK GNU C++20 (64) TESTS 54 31 1228800
168189025 30something D Aug. 13, 2022, 6:24 p.m. OK GNU C++20 (64) TESTS 54 31 1638400
168194559 SA01 D Aug. 13, 2022, 7:14 p.m. OK GNU C++20 (64) TESTS 54 31 2457600
168185992 onlytrall D Aug. 13, 2022, 6:01 p.m. OK GNU C++20 (64) TESTS 54 31 2457600
168223244 Longgggggggg D Aug. 14, 2022, 4:38 a.m. OK Java 11 TESTS 54 233 0
168181032 TCchen D Aug. 13, 2022, 5:31 p.m. OK Java 11 TESTS 54 249 0
168173208 ranglelangle D Aug. 13, 2022, 4:35 p.m. OK Java 11 TESTS 54 280 0
168226416 sf14t D Aug. 14, 2022, 5:30 a.m. OK Java 11 TESTS 54 452 18636800
168203570 AyushS_cg170 D Aug. 13, 2022, 9:16 p.m. OK Java 11 TESTS 54 499 1228800
168177428 estonishit D Aug. 13, 2022, 4:47 p.m. OK Java 11 TESTS 54 733 11673600
168212903 Mamimi D Aug. 14, 2022, 1:06 a.m. OK Java 17 TESTS 54 264 409600
168188765 Dukkha D Aug. 13, 2022, 6:22 p.m. OK Java 17 TESTS 54 436 819200
168186965 freehandle D Aug. 13, 2022, 6:08 p.m. OK Java 17 TESTS 54 873 78028800
168218457 leonlian D Aug. 14, 2022, 3:08 a.m. OK Java 8 TESTS 54 124 0
168171684 reborn.chris D Aug. 13, 2022, 4:31 p.m. OK Java 8 TESTS 54 187 0
168210008 megaspazz D Aug. 13, 2022, 11:41 p.m. OK Java 8 TESTS 54 639 2560000
168209979 megaspazz D Aug. 13, 2022, 11:40 p.m. OK Java 8 TESTS 54 639 2560000
168209833 megaspazz D Aug. 13, 2022, 11:36 p.m. OK Java 8 TESTS 54 654 2560000
168182470 1_2_3_4_5_9 D Aug. 13, 2022, 5:38 p.m. OK PyPy 2 TESTS 54 296 11366400
168203300 oadey89 D Aug. 13, 2022, 9:11 p.m. OK PyPy 2 TESTS 54 405 11571200
168182819 hxu10 D Aug. 13, 2022, 5:40 p.m. OK PyPy 3 TESTS 54 248 17817600
168178024 hxu10 D Aug. 13, 2022, 4:49 p.m. OK PyPy 3 TESTS 54 545 12902400
168177056 dhyang24 D Aug. 13, 2022, 4:46 p.m. OK PyPy 3 TESTS 54 577 11776000
168188095 sushmanth.dampur8780 D Aug. 13, 2022, 6:17 p.m. OK PyPy 3 TESTS 54 1466 19763200
168187939 sushmanth.dampur8780 D Aug. 13, 2022, 6:16 p.m. OK PyPy 3 TESTS 54 1481 19763200
168216208 BeBeBe66666 D Aug. 14, 2022, 2:20 a.m. OK PyPy 3-64 TESTS 54 233 24576000
168181072 sushmanth.dampur8780 D Aug. 13, 2022, 5:31 p.m. OK PyPy 3-64 TESTS 54 249 19148800
168175212 OpKos D Aug. 13, 2022, 4:41 p.m. OK PyPy 3-64 TESTS 54 467 16588800
168174559 huikang D Aug. 13, 2022, 4:39 p.m. OK PyPy 3-64 TESTS 54 467 17920000
168175130 bloistercvlt D Aug. 13, 2022, 4:41 p.m. OK PyPy 3-64 TESTS 54 514 13824000
168199499 Remineva D Aug. 13, 2022, 8:13 p.m. OK Python 3 TESTS 54 358 10956800
168216387 alt_ontop D Aug. 14, 2022, 2:24 a.m. OK Python 3 TESTS 54 467 9216000
168174993 AndrescuIII D Aug. 13, 2022, 4:41 p.m. OK Python 3 TESTS 54 483 11468800
168224746 sansen D Aug. 14, 2022, 5:05 a.m. OK Rust 2021 TESTS 54 31 4198400
168190287 kena0ki D Aug. 13, 2022, 6:35 p.m. OK Rust 2021 TESTS 54 31 4198400
168190945 LittleFall D Aug. 13, 2022, 6:41 p.m. OK Rust 2021 TESTS 54 31 4505600
168174394 robostac D Aug. 13, 2022, 4:39 p.m. OK Rust 2021 TESTS 54 124 6656000

remove filters

Back to search problems