Codeforces Round 822 (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
1734 Codeforces Round 822 (Div. 2) FINISHED False 7200 73245263 Sept. 23, 2022, 12:05 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6457 ) D Slime Escape PROGRAMMING data structures dp greedy two pointers

B'You are playing a game called Slime Escape. The game takes place on a number line. Initially, there are n slimes. For all positive integers i where 1 <= i <= n , the i -th slime is located at position i and has health a_i . You are controlling the slime at position k . There are two escapes located at positions 0 and n+1 . Your goal is to reach any one of the two escapes by performing any number of game moves. In one game move, you move your slime to the left or right by one position. However, if there is another slime in the new position, you must absorb it. When absorbing a slime, the health of your slime would be increased by the health of the absorbed slime, then the absorbed slime would be removed from the game. Note that some slimes might have negative health, so your health would decrease when absorbing such slimes. You lose the game immediately if your slime has negative health at any moment during the game. Can you reach one of two escapes by performing any number of game moves, without ever losing the game? Each test contains multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 20 ,000 ) -- the number of test cases. Description of the test cases follows. The first line of each test case contains two positive integers n , k ( 3 <= q n <= q 200 ,000 , 1 <= q k <= q n ) -- the number of slimes and the position of your slime. The second line of each test case contains n integers, a_1, a_2, ldots, a_n ( -10^9 <= q a_i <= q 10^9 ) -- the health of the slimes. It is guaranteed that health of your slime is non-negative ( a_k geq 0 ), and all other slimes have non-zero health ( a_i ne 0 for i ne k ). It is guaranteed that the sum of n over all test cases does not exceed 200 ,000 . For each test case, print "YES" (without quotes) if you can escape without losing, and "NO" (without quotes) otherwise'...

Tutorials

Codeforces Round #822 (Div.2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
173265330 RadioactiveDK7 D Sept. 24, 2022, 3:40 a.m. OK GNU C11 TESTS 39 124 1638400
173217462 Tyyyyyy D Sept. 23, 2022, 1:53 p.m. OK GNU C++14 TESTS 39 31 3686400
173238693 YHT_Konnyaku D Sept. 23, 2022, 4:20 p.m. OK GNU C++14 TESTS 39 31 18124800
173221047 wythend D Sept. 23, 2022, 2:02 p.m. OK GNU C++14 TESTS 39 62 819200
173217970 513487012 D Sept. 23, 2022, 1:54 p.m. OK GNU C++14 TESTS 39 62 819200
173229948 TEoS D Sept. 23, 2022, 3:07 p.m. OK GNU C++14 TESTS 39 62 819200
173266092 llll31245 D Sept. 24, 2022, 3:53 a.m. OK GNU C++14 TESTS 39 62 1638400
173241897 jiajieshi D Sept. 23, 2022, 4:50 p.m. OK GNU C++14 TESTS 39 62 1843200
173238420 juruo_c D Sept. 23, 2022, 4:18 p.m. OK GNU C++14 TESTS 39 62 2457600
173232866 yanchengzhi D Sept. 23, 2022, 3:30 p.m. OK GNU C++14 TESTS 39 62 2457600
173267291 __TRY_ D Sept. 24, 2022, 4:12 a.m. OK GNU C++14 TESTS 39 62 2457600
173239806 thantrongtri3 D Sept. 23, 2022, 4:31 p.m. OK GNU C++17 TESTS 39 62 819200
173233215 BK_sky D Sept. 23, 2022, 3:32 p.m. OK GNU C++17 TESTS 39 62 819200
173227878 MAloneM D Sept. 23, 2022, 2:53 p.m. OK GNU C++17 TESTS 39 62 819200
173261694 _cong_ D Sept. 24, 2022, 2:44 a.m. OK GNU C++17 TESTS 39 62 819200
173233033 thunopro D Sept. 23, 2022, 3:31 p.m. OK GNU C++17 TESTS 39 62 1638400
173217881 Piotrek107 D Sept. 23, 2022, 1:54 p.m. OK GNU C++17 TESTS 39 62 1638400
173258508 snavneet561 D Sept. 23, 2022, 8:03 p.m. OK GNU C++17 TESTS 39 62 1638400
173262466 kenai D Sept. 24, 2022, 2:59 a.m. OK GNU C++17 TESTS 39 62 2457600
173225071 bitagi D Sept. 23, 2022, 2:39 p.m. OK GNU C++17 TESTS 39 62 2457600
173264624 hanyhacker2001 D Sept. 24, 2022, 3:28 a.m. OK GNU C++17 TESTS 39 62 3584000
173236558 KylinKSY D Sept. 23, 2022, 4 p.m. OK GNU C++17 (64) TESTS 39 30 9830400
173229132 Y_LX D Sept. 23, 2022, 3:01 p.m. OK GNU C++17 (64) TESTS 39 31 7680000
173217939 Boa22 D Sept. 23, 2022, 1:54 p.m. OK GNU C++17 (64) TESTS 39 31 8089600
173229299 Kenshin2438 D Sept. 23, 2022, 3:02 p.m. OK GNU C++17 (64) TESTS 39 46 819200
173261617 Kellyz D Sept. 24, 2022, 2:43 a.m. OK GNU C++17 (64) TESTS 39 46 819200
173262818 -Victory- D Sept. 24, 2022, 3:04 a.m. OK GNU C++17 (64) TESTS 39 46 1638400
173236344 illume2021 D Sept. 23, 2022, 3:58 p.m. OK GNU C++17 (64) TESTS 39 46 1638400
173235745 dingdingyu D Sept. 23, 2022, 3:53 p.m. OK GNU C++17 (64) TESTS 39 46 1638400
173230449 Astronomax D Sept. 23, 2022, 3:10 p.m. OK GNU C++17 (64) TESTS 39 46 1638400
173268963 yaoveil D Sept. 24, 2022, 4:36 a.m. OK GNU C++17 (64) TESTS 39 46 1638400
173225919 Fangs D Sept. 23, 2022, 2:42 p.m. OK GNU C++20 (64) TESTS 39 15 10035200
173246907 bokunopicolo D Sept. 23, 2022, 5:44 p.m. OK GNU C++20 (64) TESTS 39 31 819200
173235513 jianguolinyun D Sept. 23, 2022, 3:51 p.m. OK GNU C++20 (64) TESTS 39 31 8806400
173235708 jianguolinyun D Sept. 23, 2022, 3:52 p.m. OK GNU C++20 (64) TESTS 39 31 8806400
173273249 Fangs D Sept. 24, 2022, 5:31 a.m. OK GNU C++20 (64) TESTS 39 31 10035200
173273286 Fangs D Sept. 24, 2022, 5:32 a.m. OK GNU C++20 (64) TESTS 39 31 10035200
173276175 Kidding_M D Sept. 24, 2022, 6 a.m. OK GNU C++20 (64) TESTS 39 46 819200
173273135 Kidding_M D Sept. 24, 2022, 5:30 a.m. OK GNU C++20 (64) TESTS 39 46 819200
173264644 Chao_zi D Sept. 24, 2022, 3:28 a.m. OK GNU C++20 (64) TESTS 39 46 819200
173244724 bokunopicolo D Sept. 23, 2022, 5:19 p.m. OK GNU C++20 (64) TESTS 39 46 819200
173236539 NIU_MA D Sept. 23, 2022, 4 p.m. OK Go TESTS 39 140 4915200
173217787 kyaruru D Sept. 23, 2022, 1:54 p.m. OK Java 11 TESTS 39 280 22630400
173247531 dzhi D Sept. 23, 2022, 5:50 p.m. OK Java 11 TESTS 39 343 2764800
173246780 dzhi D Sept. 23, 2022, 5:43 p.m. OK Java 11 TESTS 39 343 2764800
173217485 rwee1001 D Sept. 23, 2022, 1:53 p.m. OK Java 11 TESTS 39 358 2662400
173244647 leoncn D Sept. 23, 2022, 5:18 p.m. OK Java 11 TESTS 39 467 0
173243287 leoncn D Sept. 23, 2022, 5:04 p.m. OK Java 11 TESTS 39 576 2355200
173244454 leoncn D Sept. 23, 2022, 5:16 p.m. OK Java 11 TESTS 39 623 0
173235620 PriyaAnu D Sept. 23, 2022, 3:52 p.m. OK Java 11 TESTS 39 654 0
173230159 Hy3ons D Sept. 23, 2022, 3:08 p.m. OK Java 11 TESTS 39 685 42700800
173218163 merlin_ D Sept. 23, 2022, 1:55 p.m. OK Java 11 TESTS 39 966 14438400
173244429 Eslam_Ahmed D Sept. 23, 2022, 5:16 p.m. OK Java 17 TESTS 39 280 2969600
173238604 kkz666 D Sept. 23, 2022, 4:20 p.m. OK Java 17 TESTS 39 280 4915200
173230622 warks D Sept. 23, 2022, 3:12 p.m. OK Java 17 TESTS 39 654 134451200
173270055 megaspazz D Sept. 24, 2022, 4:52 a.m. OK Java 8 TESTS 39 124 3788800
173249936 notdaredevil D Sept. 23, 2022, 6:15 p.m. OK Java 8 TESTS 39 171 11776000
173230565 The_terminator D Sept. 23, 2022, 3:11 p.m. OK Java 8 TESTS 39 280 16588800
173263045 master_xqk D Sept. 24, 2022, 3:08 a.m. OK Java 8 TESTS 39 546 0
173217385 O_E D Sept. 23, 2022, 1:53 p.m. OK Java 8 TESTS 39 639 22732800
173250106 Ahmedmadbouly186 D Sept. 23, 2022, 6:17 p.m. OK MS C++ 2017 TESTS 39 264 819200
173265237 XYShaoKang D Sept. 24, 2022, 3:38 a.m. OK Node.js TESTS 39 155 26316800
173226660 1_2_3_4_5_9 D Sept. 23, 2022, 2:45 p.m. OK PyPy 2 TESTS 39 482 71372800
173225092 hxu10 D Sept. 23, 2022, 2:39 p.m. OK PyPy 3 TESTS 39 498 23142400
173216246 ilios D Sept. 23, 2022, 1:50 p.m. OK PyPy 3 TESTS 39 561 19865600
173227302 yqingping D Sept. 23, 2022, 2:49 p.m. OK PyPy 3 TESTS 39 1029 19251200
173226565 shehebe D Sept. 23, 2022, 2:45 p.m. OK PyPy 3 TESTS 39 1154 26726400
173245284 biglunchdude D Sept. 23, 2022, 5:26 p.m. OK PyPy 3-64 TESTS 39 248 28672000
173222544 jamesbansal24jan D Sept. 23, 2022, 2:04 p.m. OK PyPy 3-64 TESTS 39 249 26931200
173248078 mintplz D Sept. 23, 2022, 5:56 p.m. OK PyPy 3-64 TESTS 39 249 32153600
173216619 huangxw D Sept. 23, 2022, 1:51 p.m. OK PyPy 3-64 TESTS 39 280 31948800
173269726 voicon D Sept. 24, 2022, 4:47 a.m. OK PyPy 3-64 TESTS 39 311 28467200
173226669 abhijeet.panihar.cse20 D Sept. 23, 2022, 2:45 p.m. OK PyPy 3-64 TESTS 39 311 31334400
173226372 tryharda D Sept. 23, 2022, 2:44 p.m. OK PyPy 3-64 TESTS 39 311 31334400
173219719 govindp47 D Sept. 23, 2022, 1:58 p.m. OK PyPy 3-64 TESTS 39 311 31948800
173249442 titia D Sept. 23, 2022, 6:10 p.m. OK PyPy 3-64 TESTS 39 342 29286400
173242111 deepaklaksman D Sept. 23, 2022, 4:52 p.m. OK PyPy 3-64 TESTS 39 343 25702400
173221773 NS3081992 D Sept. 23, 2022, 2:03 p.m. OK Python 3 TESTS 39 405 16486400
173219193 siddharthraj D Sept. 23, 2022, 1:57 p.m. OK Python 3 TESTS 39 514 16486400
173235862 Egor D Sept. 23, 2022, 3:54 p.m. OK Rust 2021 TESTS 39 31 7987200
173239726 liut D Sept. 23, 2022, 4:31 p.m. OK Rust 2021 TESTS 39 46 3174400
173248598 kobae964 D Sept. 23, 2022, 6:01 p.m. OK Rust 2021 TESTS 39 62 7884800

remove filters

Back to search problems