Codeforces Round 827 (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
1742 Codeforces Round 827 (Div. 4) FINISHED False 8700 71508263 Oct. 13, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 26489 ) E Scuza PROGRAMMING binary search greedy math

B"Timur has a stairway with n steps. The i -th step is a_i meters higher than its predecessor. The first step is a_1 meters higher than the ground, and the ground starts at 0 meters. Timur has q questions, each denoted by an integer k_1, ... , k_q . For each question k_i , you have to print the maximum possible height Timur can achieve by climbing the steps if his legs are of length k_i . Timur can only climb the j -th step if his legs are of length at least a_j . In other words, k_i geq a_j for each step j climbed. Note that you should answer each question independently. The first line contains a single integer t ( 1 <= q t <= q 100 ) -- the number of test cases. The first line of each test case contains two integers n, q ( 1 <= q n, q <= q 2 cdot10^5 ) -- the number of steps and the number of questions, respectively. The second line of each test case contains n integers ( 1 <= q a_i <= q 10^9 ) -- the height of the steps. The third line of each test case contains q integers ( 0 <= q k_i <= q 10^9 ) -- the numbers for each question. It is guaranteed that the sum of n does not exceed 2 cdot10^5 , and the sum of q does not exceed 2 cdot10^5 . For each test case, output a single line containing q integers, the answer for each question. Please note, that the answer for some questions won't fit into 32-bit integer type, so you should use at least 64-bit integer type in your programming language (like long long for C++). Consider the first test case, pictured in the statement. "...

Tutorials

107962

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
176097249 bkifhr7 E Oct. 14, 2022, 4:43 a.m. OK Clang++17 Diagnostics TESTS 12 2947 23142400
176097163 bkifhr10 E Oct. 14, 2022, 4:42 a.m. OK Clang++20 Diagnostics TESTS 12 2979 23142400
176079692 Uanu E Oct. 13, 2022, 11:51 p.m. OK GNU C11 TESTS 12 1029 8499200
176085925 HIT_xmssgg E Oct. 14, 2022, 2:02 a.m. OK GNU C11 TESTS 12 1107 10137600
176102284 tokitsukaze E Oct. 14, 2022, 5:42 a.m. OK GNU C++14 TESTS 12 109 7065600
176098639 Mr.Cookie E Oct. 14, 2022, 5:02 a.m. OK GNU C++14 TESTS 12 187 5632000
176095055 Xiaoruolii E Oct. 14, 2022, 4:13 a.m. OK GNU C++14 TESTS 12 202 2355200
176097319 ayushnautiyal1110 E Oct. 14, 2022, 4:44 a.m. OK GNU C++14 TESTS 12 202 3891200
176082963 2598827139 E Oct. 14, 2022, 1:08 a.m. OK GNU C++14 TESTS 12 202 5017600
176081750 kingdomsouth E Oct. 14, 2022, 12:45 a.m. OK GNU C++14 TESTS 12 202 5427200
176078270 octoant E Oct. 13, 2022, 11:01 p.m. OK GNU C++14 TESTS 12 202 5836800
176060456 NourMahmoud50 E Oct. 13, 2022, 6:34 p.m. OK GNU C++14 TESTS 12 217 2355200
176068576 _vaibhavr_ E Oct. 13, 2022, 7:58 p.m. OK GNU C++14 TESTS 12 217 4300800
176101675 kingdomsouth E Oct. 14, 2022, 5:36 a.m. OK GNU C++14 TESTS 12 217 6348800
176089883 17658592801 nekoyukino E Oct. 14, 2022, 2:59 a.m. OK GNU C++17 TESTS 12 124 14848000
176082357 PUNGqw E Oct. 14, 2022, 12:56 a.m. OK GNU C++17 TESTS 12 186 5120000
176096998 maximus_jager E Oct. 14, 2022, 4:40 a.m. OK GNU C++17 TESTS 12 202 3174400
176093828 ty_bj_sty E Oct. 14, 2022, 3:55 a.m. OK GNU C++17 TESTS 12 202 3174400
176097043 HARXH E Oct. 14, 2022, 4:41 a.m. OK GNU C++17 TESTS 12 202 3788800
176094794 rahulnayak E Oct. 14, 2022, 4:09 a.m. OK GNU C++17 TESTS 12 202 3788800
176088360 ttkk E Oct. 14, 2022, 2:37 a.m. OK GNU C++17 TESTS 12 202 4300800
176077542 Potoccino. E Oct. 13, 2022, 10:37 p.m. OK GNU C++17 TESTS 12 202 7168000
176090156 lqmm E Oct. 14, 2022, 3:03 a.m. OK GNU C++17 TESTS 12 202 16076800
176099307 __MASH__ E Oct. 14, 2022, 5:09 a.m. OK GNU C++17 TESTS 12 217 2457600
176070676 SorryMateWrongPath E Oct. 13, 2022, 8:24 p.m. OK GNU C++17 (64) TESTS 12 124 7680000
176078949 TrendBattles E Oct. 13, 2022, 11:25 p.m. OK GNU C++17 (64) TESTS 12 140 3584000
176068506 maxcruickshanks E Oct. 13, 2022, 7:57 p.m. OK GNU C++17 (64) TESTS 12 140 3584000
176074950 HunterKasa E Oct. 13, 2022, 9:36 p.m. OK GNU C++17 (64) TESTS 12 140 10649600
176100965 HP_BenLadeN E Oct. 14, 2022, 5:28 a.m. OK GNU C++17 (64) TESTS 12 140 12185600
176097090 vjudge2 E Oct. 14, 2022, 4:41 a.m. OK GNU C++17 (64) TESTS 12 155 2457600
176091154 lovezah E Oct. 14, 2022, 3:17 a.m. OK GNU C++17 (64) TESTS 12 155 3174400
176097814 anmichi E Oct. 14, 2022, 4:51 a.m. OK GNU C++17 (64) TESTS 12 155 4812800
176083760 joao.breno.ro17 E Oct. 14, 2022, 1:23 a.m. OK GNU C++17 (64) TESTS 12 155 6041600
176081439 DjTang E Oct. 14, 2022, 12:38 a.m. OK GNU C++17 (64) TESTS 12 155 6041600
176096694 SummerWind E Oct. 14, 2022, 4:36 a.m. OK GNU C++20 (64) TESTS 12 93 3993600
176065037 vikash_maurya E Oct. 13, 2022, 7:18 p.m. OK GNU C++20 (64) TESTS 12 93 4812800
176075689 spade0211 E Oct. 13, 2022, 9:51 p.m. OK GNU C++20 (64) TESTS 12 93 6041600
176091912 Neaj_Morshad_101 E Oct. 14, 2022, 3:28 a.m. OK GNU C++20 (64) TESTS 12 108 3174400
176082751 Nondifferentiable E Oct. 14, 2022, 1:04 a.m. OK GNU C++20 (64) TESTS 12 108 3686400
176096810 TruongCongQuocTrieu E Oct. 14, 2022, 4:38 a.m. OK GNU C++20 (64) TESTS 12 108 3993600
176076057 Mostafa_arafa E Oct. 13, 2022, 9:59 p.m. OK GNU C++20 (64) TESTS 12 108 4505600
176083375 EbrahimElhabashy E Oct. 14, 2022, 1:15 a.m. OK GNU C++20 (64) TESTS 12 108 4505600
176064673 Krish47 E Oct. 13, 2022, 7:14 p.m. OK GNU C++20 (64) TESTS 12 108 4505600
176069346 ME23dec21 E Oct. 13, 2022, 8:07 p.m. OK GNU C++20 (64) TESTS 12 108 4812800
176072606 shiro E Oct. 13, 2022, 8:54 p.m. OK Go TESTS 12 264 23142400
176077099 princeayush04 E Oct. 13, 2022, 10:25 p.m. OK Java 11 TESTS 12 389 35123200
176069712 Vegeks E Oct. 13, 2022, 8:11 p.m. OK Java 11 TESTS 12 420 32153600
176053858 anub_12 E Oct. 13, 2022, 5:43 p.m. OK Java 11 TESTS 11 421 35020800
176094324 gouse_1273 E Oct. 14, 2022, 4:02 a.m. OK Java 11 TESTS 12 592 28364800
176063576 kb_0311 E Oct. 13, 2022, 7:03 p.m. OK Java 11 TESTS 12 623 50278400
176054835 wolfy_thee_wolf E Oct. 13, 2022, 5:49 p.m. OK Java 11 TESTS 11 841 25497600
176084067 yerkebayev E Oct. 14, 2022, 1:29 a.m. OK Java 11 TESTS 12 1045 35225600
176056241 rajneesh.osho E Oct. 13, 2022, 6 p.m. OK Java 11 TESTS 11 1169 30617600
176066275 _bakytov_ E Oct. 13, 2022, 7:31 p.m. OK Java 11 TESTS 12 1263 51302400
176098202 Saurabh_jayaswal E Oct. 14, 2022, 4:56 a.m. OK Java 11 TESTS 12 1450 6553600
176067128 b1rr0 E Oct. 13, 2022, 7:41 p.m. OK Java 17 TESTS 12 763 81408000
176090605 a_dev E Oct. 14, 2022, 3:09 a.m. OK Java 17 TESTS 12 1044 11366400
176083566 -Jarvis- E Oct. 14, 2022, 1:19 a.m. OK Java 17 TESTS 12 1075 48640000
176090483 PartinGQAQ E Oct. 14, 2022, 3:08 a.m. OK Java 17 TESTS 12 1668 39116800
176103713 garuda5611 E Oct. 14, 2022, 5:56 a.m. OK Java 17 TESTS 12 1794 819200
176066033 Diaa12360 E Oct. 13, 2022, 7:28 p.m. OK Java 8 TESTS 12 186 19046400
176059167 Mohamed308 E Oct. 13, 2022, 6:23 p.m. OK Java 8 TESTS 12 280 19865600
176100654 Kaldaruly E Oct. 14, 2022, 5:25 a.m. OK Java 8 TESTS 12 311 16896000
176069698 gagan_6730 E Oct. 13, 2022, 8:11 p.m. OK Java 8 TESTS 12 311 47923200
176054944 pottiVJ E Oct. 13, 2022, 5:50 p.m. OK Java 8 TESTS 11 312 12697600
176091309 frey4 E Oct. 14, 2022, 3:19 a.m. OK Java 8 TESTS 12 405 31436800
176078171 Mouhssine E Oct. 13, 2022, 10:57 p.m. OK Java 8 TESTS 12 420 40243200
176061309 sachinjaiswal E Oct. 13, 2022, 6:41 p.m. OK Java 8 TESTS 12 467 20684800
176059467 Karakurik E Oct. 13, 2022, 6:25 p.m. OK Java 8 TESTS 12 498 20172800
176066878 Unrated_Pritam E Oct. 13, 2022, 7:38 p.m. OK Java 8 TESTS 12 592 50892800
176063850 Bloodwyn E Oct. 13, 2022, 7:06 p.m. OK Kotlin 1.6 TESTS 12 701 58675200
176056017 hot_chert E Oct. 13, 2022, 5:58 p.m. OK MS C++ 2017 TESTS 11 529 5939200
176055935 OmarRnr E Oct. 13, 2022, 5:57 p.m. OK MS C++ 2017 TESTS 11 592 11980800
176055761 OmarRnr E Oct. 13, 2022, 5:56 p.m. OK MS C++ 2017 TESTS 11 608 12390400
176087568 sahalaxiaohaiyang E Oct. 14, 2022, 2:26 a.m. OK MS C++ 2017 TESTS 12 1123 3379200
176058818 yashsarda2002 E Oct. 13, 2022, 6:20 p.m. OK PyPy 3 TESTS 12 546 65126400
176095711 FrozenKandy E Oct. 14, 2022, 4:22 a.m. OK PyPy 3 TESTS 12 795 35225600
176057993 jamerrq E Oct. 13, 2022, 6:14 p.m. OK PyPy 3 TESTS 11 872 59596800
176079839 aneesh2002 E Oct. 13, 2022, 11:57 p.m. OK PyPy 3 TESTS 12 889 48435200
176055063 sheshank10 E Oct. 13, 2022, 5:51 p.m. OK PyPy 3 TESTS 11 904 45568000
176095391 FrozenKandy E Oct. 14, 2022, 4:18 a.m. OK PyPy 3 TESTS 12 935 52326400
176059971 Gunbnelch31 E Oct. 13, 2022, 6:30 p.m. OK PyPy 3 TESTS 12 1029 48025600
176055187 hamzaawashra100 E Oct. 13, 2022, 5:52 p.m. OK PyPy 3 TESTS 11 1263 51814400
176056484 Amiy_Tiwari E Oct. 13, 2022, 6:01 p.m. OK PyPy 3 TESTS 11 1482 56832000
176088765 mintplz E Oct. 14, 2022, 2:42 a.m. OK PyPy 3-64 TESTS 12 249 35840000
176097148 samchen123 E Oct. 14, 2022, 4:42 a.m. OK PyPy 3-64 TESTS 12 264 33587200
176097336 Yarq373 E Oct. 14, 2022, 4:44 a.m. OK PyPy 3-64 TESTS 12 280 33894400
176067941 noobsatish E Oct. 13, 2022, 7:50 p.m. OK PyPy 3-64 TESTS 12 280 47104000
176055175 2momo2 E Oct. 13, 2022, 5:52 p.m. OK PyPy 3-64 TESTS 11 296 67788800
176099667 Code_Breaker101 E Oct. 14, 2022, 5:13 a.m. OK PyPy 3-64 TESTS 12 311 32256000
176097257 Yarq373 E Oct. 14, 2022, 4:44 a.m. OK PyPy 3-64 TESTS 12 311 34304000
176053066 lemoon_05 E Oct. 13, 2022, 5:38 p.m. OK PyPy 3-64 TESTS 11 312 65126400
176054158 shubh67678 E Oct. 13, 2022, 5:45 p.m. OK PyPy 3-64 TESTS 11 312 81612800
176103161 pris0ner E Oct. 14, 2022, 5:51 a.m. OK PyPy 3-64 TESTS 12 327 34099200
176089758 2000031824 E Oct. 14, 2022, 2:57 a.m. OK Python 3 TESTS 12 811 28569600
176074392 Aman_cool E Oct. 13, 2022, 9:25 p.m. OK Python 3 TESTS 12 982 33587200
176055838 hith_am E Oct. 13, 2022, 5:56 p.m. OK Python 3 TESTS 11 1123 30412800
176079026 vannamsc E Oct. 13, 2022, 11:27 p.m. OK Python 3 TESTS 12 2339 26214400
176099266 freshnewname E Oct. 14, 2022, 5:09 a.m. OK Rust 2021 TESTS 12 61 4300800
176085053 liut E Oct. 14, 2022, 1:47 a.m. OK Rust 2021 TESTS 12 109 4812800

remove filters

Back to search problems