Codeforces Round 810 (Div. 1)

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
1710 Codeforces Round 810 (Div. 1) FINISHED False 7200 73149899 July 24, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 2494 ) B Rain PROGRAMMING brute force data structures math

B"You are the owner of a harvesting field which can be modeled as an infinite line, whose positions are identified by integers. It will rain for the next n days. On the i -th day, the rain will be centered at position x_i and it will have intensity p_i . Due to these rains, some rainfall will accumulate; let a_j be the amount of rainfall accumulated at integer position j . Initially a_j is 0 , and it will increase by max(0,p_i-|x_i-j|) after the i -th day's rain. A flood will hit your field if, at any moment, there is a position j with accumulated rainfall a_j>m . You can use a magical spell to erase exactly one day's rain, i.e., setting p_i=0 . For each i from 1 to n , check whether in case of erasing the i -th day's rain there is no flood. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= q t <= q 10^4 ). The description of the test cases follows. The first line of each test case contains two integers n and m ( 1 <= q n <= q 2 cdot 10^5 , 1 <= q m <= q 10^9 ) -- the number of rainy days and the maximal accumulated rainfall with no flood occurring. Then n lines follow. The i -th of these lines contains two integers x_i and p_i ( 1 <= q x_i,p_i <= q 10^9 ) -- the position and intensity of the i -th day's rain. The sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a binary string s length of n . The i -th character of s is 1 if after erasing the i -th day's rain there is no flood, while it is 0, if after erasing the i -th day's rain the flood still happens. In the first test case, if we do not use the spell, the accumulated rainfall distribution will be like this: If we erase the third day's rain, the flood is avoided and the accumulated rainfall distribution looks like this: "...

Tutorials

Codeforces Round #810 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
165548668 hos.lyric B July 24, 2022, 2:50 p.m. OK D TESTS 28 514 35430400
165576232 Gassa B July 24, 2022, 4:02 p.m. OK D TESTS 28 529 47820800
165601932 rainboy B July 24, 2022, 7:42 p.m. OK GNU C11 TESTS 28 187 31436800
165592118 chro4896 B July 24, 2022, 5:49 p.m. OK GNU C11 TESTS 28 436 16588800
165568290 Chtanda_El B July 24, 2022, 3:37 p.m. OK GNU C++14 TESTS 28 140 6451200
165580075 wh_ZH B July 24, 2022, 4:14 p.m. OK GNU C++14 TESTS 28 156 9625600
165558062 Suiseiseki B July 24, 2022, 3:09 p.m. OK GNU C++14 TESTS 28 171 14643200
165565174 Krystallos B July 24, 2022, 3:29 p.m. OK GNU C++14 TESTS 28 186 13619200
165560471 Obsidian B July 24, 2022, 3:16 p.m. OK GNU C++14 TESTS 28 187 6451200
165557192 Alfnov B July 24, 2022, 3:07 p.m. OK GNU C++14 TESTS 28 187 12083200
165581357 rui_er B July 24, 2022, 4:18 p.m. OK GNU C++14 TESTS 28 202 9625600
165561761 AlternatingCurrent B July 24, 2022, 3:19 p.m. OK GNU C++14 TESTS 28 202 15155200
165570261 sbzhangjianjun B July 24, 2022, 3:43 p.m. OK GNU C++14 TESTS 28 202 18636800
165631895 KbltQaQ B July 25, 2022, 5:40 a.m. OK GNU C++14 TESTS 28 202 22016000
165591934 Bobocan B July 24, 2022, 5:47 p.m. OK GNU C++17 TESTS 28 108 12492800
165565342 123hei B July 24, 2022, 3:29 p.m. OK GNU C++17 TESTS 28 156 6963200
165576910 farmerboy B July 24, 2022, 4:04 p.m. OK GNU C++17 TESTS 28 171 7577600
165579692 withinlover B July 24, 2022, 4:12 p.m. OK GNU C++17 TESTS 28 171 14028800
165556406 Dreamunk B July 24, 2022, 3:05 p.m. OK GNU C++17 TESTS 28 202 12800000
165581263 koderkushy B July 24, 2022, 4:18 p.m. OK GNU C++17 TESTS 28 202 17305600
165569160 Derzeed B July 24, 2022, 3:40 p.m. OK GNU C++17 TESTS 28 202 21401600
165565716 p_s_c_ B July 24, 2022, 3:30 p.m. OK GNU C++17 TESTS 28 202 27443200
165569114 lmlmlm B July 24, 2022, 3:39 p.m. OK GNU C++17 TESTS 28 217 19251200
165572725 forelax B July 24, 2022, 3:50 p.m. OK GNU C++17 TESTS 28 217 27340800
165564759 cuiaoxiang B July 24, 2022, 3:27 p.m. OK GNU C++17 (64) TESTS 28 124 8499200
165566462 5ab B July 24, 2022, 3:32 p.m. OK GNU C++17 (64) TESTS 28 140 12800000
165572928 Xellos B July 24, 2022, 3:51 p.m. OK GNU C++17 (64) TESTS 28 140 13312000
165577399 basic_string B July 24, 2022, 4:05 p.m. OK GNU C++17 (64) TESTS 28 140 15462400
165575112 fgvjkshuifd B July 24, 2022, 3:58 p.m. OK GNU C++17 (64) TESTS 28 140 18534400
165564907 enjapma B July 24, 2022, 3:28 p.m. OK GNU C++17 (64) TESTS 28 140 29491200
165564024 Merlininice B July 24, 2022, 3:25 p.m. OK GNU C++17 (64) TESTS 28 155 6451200
165575290 AutumnKite B July 24, 2022, 3:58 p.m. OK GNU C++17 (64) TESTS 28 155 10137600
165565317 davi_bart B July 24, 2022, 3:29 p.m. OK GNU C++17 (64) TESTS 28 155 20787200
165604448 enslaved B July 24, 2022, 8:23 p.m. OK GNU C++17 (64) TESTS 28 155 29081600
165576544 sky3141 B July 24, 2022, 4:02 p.m. OK GNU C++20 (64) TESTS 28 109 11059200
165562389 Tutis B July 24, 2022, 3:21 p.m. OK GNU C++20 (64) TESTS 28 124 5836800
165600934 ecnerwala B July 24, 2022, 7:28 p.m. OK GNU C++20 (64) TESTS 28 124 12800000
165600983 ecnerwala B July 24, 2022, 7:29 p.m. OK GNU C++20 (64) TESTS 28 124 12800000
165576552 s20b1_chernikov B July 24, 2022, 4:02 p.m. OK GNU C++20 (64) TESTS 28 124 20684800
165592693 fredy10 B July 24, 2022, 5:53 p.m. OK GNU C++20 (64) TESTS 28 139 29491200
165558133 antekb B July 24, 2022, 3:10 p.m. OK GNU C++20 (64) TESTS 28 140 15462400
165555440 jeroenodb B July 24, 2022, 3:03 p.m. OK GNU C++20 (64) TESTS 28 140 20992000
165578098 pperm B July 24, 2022, 4:07 p.m. OK GNU C++20 (64) TESTS 28 140 21811200
165568101 ZZZGen B July 24, 2022, 3:37 p.m. OK GNU C++20 (64) TESTS 28 140 29491200
165621540 36champ B July 25, 2022, 2:42 a.m. OK Java 11 TESTS 28 795 22630400
165594504 dusty.and.rusty B July 24, 2022, 6:08 p.m. OK Java 11 TESTS 28 919 41574400
165593282 dusty.and.rusty B July 24, 2022, 5:58 p.m. OK Java 11 TESTS 28 951 41779200
165566521 profchi B July 24, 2022, 3:32 p.m. OK Java 11 TESTS 28 1434 93593600
165579090 DylanSmith B July 24, 2022, 4:10 p.m. OK Java 8 TESTS 28 1559 120832000
165595446 DarLam B July 24, 2022, 6:18 p.m. OK Java 8 TESTS 28 3041 136806400
165559511 Hakiobo B July 24, 2022, 3:13 p.m. OK Kotlin 1.4 TESTS 28 842 29081600
165568979 arvindf232 B July 24, 2022, 3:39 p.m. OK Kotlin 1.6 TESTS 28 1606 161894400
165571489 ruimina B July 24, 2022, 3:47 p.m. OK PyPy 3 TESTS 28 3853 72499200
165591565 siganai B July 24, 2022, 5:45 p.m. OK PyPy 3-64 TESTS 28 997 62566400
165566183 toam B July 24, 2022, 3:31 p.m. OK PyPy 3-64 TESTS 28 1387 74240000
165558598 chinerist B July 24, 2022, 3:11 p.m. OK PyPy 3-64 TESTS 28 1778 120217600
165597967 alanmiller B July 24, 2022, 6:48 p.m. OK PyPy 3-64 TESTS 28 2293 194662400
165609920 huikang B July 24, 2022, 10:15 p.m. OK PyPy 3-64 TESTS 28 2433 134553600
165579515 titia B July 24, 2022, 4:12 p.m. OK PyPy 3-64 TESTS 28 2527 220876800
165563566 huikang B July 24, 2022, 3:24 p.m. OK PyPy 3-64 TESTS 28 2620 144076800
165566749 r57shell B July 24, 2022, 3:33 p.m. OK PyPy 3-64 TESTS 28 3182 95232000
165609250 duck702702 B July 24, 2022, 9:58 p.m. OK PyPy 3-64 TESTS 28 3962 222822400
165627107 huikang B July 25, 2022, 4:14 a.m. OK Python 3 TESTS 28 2261 128716800
165579104 CodingJellyfish B July 24, 2022, 4:10 p.m. OK Rust 2021 TESTS 28 327 218112000
165560276 sansen B July 24, 2022, 3:15 p.m. OK Rust 2021 TESTS 28 342 79360000

remove filters

Back to search problems