Codeforces Round 849 (Div. 4)

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
1791 Codeforces Round 849 (Div. 4) FINISHED False 8700 61745062 Feb. 3, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 4939 ) G2 Teleporters (Hard Version) PROGRAMMING binary search greedy sortings

B"The only difference between the easy and hard versions are the locations you can teleport to. Consider the points 0,1, ... ,n+1 on the number line. There is a teleporter located on each of the points 1,2, ... ,n . At point i , you can do the following: You have c coins, and you start at point 0 . What's the most number of teleporters you can use? The input consists of multiple test cases. The first line contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The descriptions of the test cases follow. The first line of each test case contains two integers n and c ( 1 <= q n <= q 2 cdot10^5 ; 1 <= q c <= q 10^9 ) -- the length of the array and the number of coins you have respectively. The following line contains n space-separated positive integers a_1,a_2, ... ,a_n ( 1 <= q a_i <= q 10^9 ) -- the costs to use the teleporters. It is guaranteed that the sum of n over all test cases does not exceed 2 cdot10^5 . For each test case, output the maximum number of teleporters you can use. In the first test case, you can move one unit to the right, use the teleporter at index 1 and teleport to point n+1 , move one unit to the left and use the teleporter at index 5 . You are left with 6-1-1-1-1 = 2 coins, and wherever you teleport, you won't have enough coins to use another teleporter. You have used two teleporters, so the answer is two. In the second test case, you go four units to the right and use the teleporter to go to n+1 , then go three units left and use the teleporter at index 6 to go to n+1 , and finally, you go left four times and use the teleporter. The total cost will be 4+6+3+4+4+9 = 30 , and you used three teleporters. In the third test case, you don't have enough coins to use any teleporter, so the answer is zero. "...

Tutorials

112282

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
192088642 chrisTris G2 Feb. 4, 2023, 2:33 a.m. OK C# 10 TESTS 16 171 39116800
192095645 Liswiera G2 Feb. 4, 2023, 4:25 a.m. OK C# 10 TESTS 16 202 34201600
192104438 dianhsu_scarlet G2 Feb. 4, 2023, 5:59 a.m. OK GNU C++14 TESTS 16 77 4300800
192087177 bkifhr8 G2 Feb. 4, 2023, 2:09 a.m. OK GNU C++14 TESTS 16 78 4300800
192089627 Shuishui_0921 G2 Feb. 4, 2023, 2:49 a.m. OK GNU C++14 TESTS 16 78 5120000
192075507 Alumin1um G2 Feb. 3, 2023, 9:52 p.m. OK GNU C++14 TESTS 16 78 5836800
192061320 ItsAboudTime G2 Feb. 3, 2023, 7:13 p.m. OK GNU C++14 TESTS 16 78 6656000
192103444 Microchip G2 Feb. 4, 2023, 5:50 a.m. OK GNU C++14 TESTS 16 93 4300800
192056437 wishgoodluck G2 Feb. 3, 2023, 6:35 p.m. OK GNU C++14 TESTS 16 93 4300800
192097847 Bai_xiaobo G2 Feb. 4, 2023, 4:54 a.m. OK GNU C++14 TESTS 16 93 5836800
192095988 nguyennhat.110120 G2 Feb. 4, 2023, 4:30 a.m. OK GNU C++14 TESTS 16 93 5836800
192086085 Spouter_27 G2 Feb. 4, 2023, 1:48 a.m. OK GNU C++14 TESTS 16 93 9113600
192096046 Daksh_Axel G2 Feb. 4, 2023, 4:31 a.m. OK GNU C++17 TESTS 16 62 2457600
192103450 longcheng_x G2 Feb. 4, 2023, 5:50 a.m. OK GNU C++17 TESTS 16 77 16179200
192103280 Sindy G2 Feb. 4, 2023, 5:49 a.m. OK GNU C++17 TESTS 16 78 4300800
192099176 kevco G2 Feb. 4, 2023, 5:10 a.m. OK GNU C++17 TESTS 16 78 4300800
192067555 Weiqt G2 Feb. 3, 2023, 8:11 p.m. OK GNU C++17 TESTS 16 78 4300800
192067335 Weiqt G2 Feb. 3, 2023, 8:09 p.m. OK GNU C++17 TESTS 16 78 4300800
192063775 keep_mind G2 Feb. 3, 2023, 7:35 p.m. OK GNU C++17 TESTS 16 78 4300800
192063545 keep_mind G2 Feb. 3, 2023, 7:33 p.m. OK GNU C++17 TESTS 16 78 4300800
192053250 justHusam G2 Feb. 3, 2023, 6:13 p.m. OK GNU C++17 TESTS 16 78 5120000
192054086 zzhrnoicansolve G2 Feb. 3, 2023, 6:18 p.m. OK GNU C++17 TESTS 16 78 6656000
192082852 mykhail0 G2 Feb. 4, 2023, 12:35 a.m. OK GNU C++17 (64) TESTS 16 46 7372800
192103587 yiyiyize G2 Feb. 4, 2023, 5:51 a.m. OK GNU C++17 (64) TESTS 16 61 5222400
192092705 Lin_ G2 Feb. 4, 2023, 3:39 a.m. OK GNU C++17 (64) TESTS 16 61 6041600
192059278 enslaved G2 Feb. 3, 2023, 6:56 p.m. OK GNU C++17 (64) TESTS 16 61 6041600
192071166 bkifhr9 G2 Feb. 3, 2023, 8:53 p.m. OK GNU C++17 (64) TESTS 16 61 10342400
192098553 ppnoonbb G2 Feb. 4, 2023, 5:03 a.m. OK GNU C++17 (64) TESTS 16 62 4403200
192070168 vora_dev G2 Feb. 3, 2023, 8:41 p.m. OK GNU C++17 (64) TESTS 16 62 6041600
192050392 Lycoris G2 Feb. 3, 2023, 5:55 p.m. OK GNU C++17 (64) TESTS 16 62 6860800
192089672 gzh_ G2 Feb. 4, 2023, 2:49 a.m. OK GNU C++17 (64) TESTS 16 62 7680000
192071569 vjudge5 G2 Feb. 3, 2023, 8:58 p.m. OK GNU C++17 (64) TESTS 16 62 8704000
192103573 Silencer76 G2 Feb. 4, 2023, 5:51 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192102412 Kaitoukid G2 Feb. 4, 2023, 5:40 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192097191 Krishna_Bhakt_Anuj G2 Feb. 4, 2023, 4:47 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192094670 zhaoxl2003 G2 Feb. 4, 2023, 4:11 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192089841 TreeQwQ G2 Feb. 4, 2023, 2:52 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192089112 ankushkhanna G2 Feb. 4, 2023, 2:41 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192084385 Desh01 G2 Feb. 4, 2023, 1:12 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192084345 Desh01 G2 Feb. 4, 2023, 1:11 a.m. OK GNU C++20 (64) TESTS 16 46 4505600
192062765 Aadey_Shah G2 Feb. 3, 2023, 7:27 p.m. OK GNU C++20 (64) TESTS 16 46 4505600
192057224 cjk041212 G2 Feb. 3, 2023, 6:40 p.m. OK GNU C++20 (64) TESTS 16 46 4505600
192098062 july_tang G2 Feb. 4, 2023, 4:57 a.m. OK Go TESTS 16 93 26521600
192076955 meinego G2 Feb. 3, 2023, 10:16 p.m. OK Go TESTS 16 156 27545600
192071532 meinego G2 Feb. 3, 2023, 8:57 p.m. OK Go TESTS 16 171 26726400
192066424 meinego G2 Feb. 3, 2023, 8 p.m. OK Go TESTS 16 171 26726400
192065174 meinego G2 Feb. 3, 2023, 7:48 p.m. OK Go TESTS 16 171 26726400
192080467 meinego G2 Feb. 3, 2023, 11:31 p.m. OK Go TESTS 16 171 27545600
192066323 meinego G2 Feb. 3, 2023, 7:59 p.m. OK Go TESTS 16 186 27545600
192075063 sam02202001 G2 Feb. 3, 2023, 9:45 p.m. OK Java 11 TESTS 16 405 44134400
192059690 uttaran_das G2 Feb. 3, 2023, 6:59 p.m. OK Java 11 TESTS 16 468 43827200
192101164 mumuxinfei G2 Feb. 4, 2023, 5:29 a.m. OK Java 17 TESTS 16 436 65331200
192074542 Yuh_03 G2 Feb. 3, 2023, 9:37 p.m. OK Java 17 TESTS 16 452 61132800
192050835 n0obie G2 Feb. 3, 2023, 5:57 p.m. OK Java 8 TESTS 16 264 25395200
192097942 AS_1729 G2 Feb. 4, 2023, 4:55 a.m. OK Java 8 TESTS 16 327 97280000
192104154 rahul_81 G2 Feb. 4, 2023, 5:56 a.m. OK Java 8 TESTS 16 373 37683200
192059286 ccj123 G2 Feb. 3, 2023, 6:56 p.m. OK Java 8 TESTS 16 405 54784000
192084059 IanISam G2 Feb. 4, 2023, 1:04 a.m. OK Java 8 TESTS 16 577 42188800
192054161 gaspar.kristijan G2 Feb. 3, 2023, 6:19 p.m. OK MS C++ 2017 TESTS 16 374 17817600
192051875 Anlx2000 G2 Feb. 3, 2023, 6:04 p.m. OK PyPy 3 TESTS 16 951 42496000
192056174 hash1025 G2 Feb. 3, 2023, 6:33 p.m. OK PyPy 3 TESTS 16 966 47513600
192084907 RobinFromTheHood G2 Feb. 4, 2023, 1:24 a.m. OK PyPy 3-64 TESTS 16 218 59392000
192057172 34z12000 G2 Feb. 3, 2023, 6:40 p.m. OK PyPy 3-64 TESTS 16 436 64512000
192064746 Rosiwerk G2 Feb. 3, 2023, 7:44 p.m. OK PyPy 3-64 TESTS 16 546 66764800
192049719 De-Bug G2 Feb. 3, 2023, 5:51 p.m. OK PyPy 3-64 TESTS 16 717 55398400
192055414 horrlod G2 Feb. 3, 2023, 6:27 p.m. OK PyPy 3-64 TESTS 16 733 100352000
192084571 hvbird G2 Feb. 4, 2023, 1:17 a.m. OK PyPy 3-64 TESTS 16 748 69324800
192084529 hvbird G2 Feb. 4, 2023, 1:16 a.m. OK PyPy 3-64 TESTS 16 779 68812800
192080836 hvbird G2 Feb. 3, 2023, 11:40 p.m. OK PyPy 3-64 TESTS 16 779 70860800
192080877 hvbird G2 Feb. 3, 2023, 11:41 p.m. OK PyPy 3-64 TESTS 16 795 68505600
192101467 wwwwzhh G2 Feb. 4, 2023, 5:32 a.m. OK PyPy 3-64 TESTS 16 811 199168000
192083888 vjudge1 G2 Feb. 4, 2023, 1 a.m. OK Rust 2021 TESTS 16 46 16793600

remove filters

Back to search problems