Codeforces Round 1076 (Div. 3)

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
2193 Codeforces Round 1076 (Div. 3) FINISHED False 8100 7053923 Jan. 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8302 ) F Pizza Delivery PROGRAMMING dp greedy

Courier YF has earned the title of the best pizza delivery person GR. The manager does not like him, so he decided to give him a very difficult task. The manager provided him with (n) coordinates of houses ((x_i, y_i)) where he needs to deliver the pizza. He will deliver the pizza in the following way: GR pizza is prepared at the point ((Ax, Ay)) and YF starts the delivery from this point. To deliver the pizza, he can move from the point ((x, y)) to three points ((x+1, y)), ((x, y+1)), ((x, y-1)). After he has delivered all the pizzas, he returns home to the point ((Bx, By)). Each move takes him exactly one second, and handing over the pizza to the customer takes (0) seconds. The manager wants the delivery to be as fast as possible. You need to find the minimum delivery time for all GR pizzas. It is guaranteed that delivery is always possible. Each test consists of several test cases. The first line contains one integer (t) ((1 \le t \le 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains five integers (n), (Ax), (Ay), (Bx), (By) ((1 \le n \le 2 \cdot 10^5), (1 \le Ax, Ay, Bx, By \le 10^9)) — the number of houses for delivery, as well as the coordinates of the start and end points. The second line of each test case contains (n) integers (x_1, x_2, \dots, x_n) ((Ax \lt x_i \lt Bx)). The third line of each test case contains (n) integers (y_1, y_2, \dots, y_n) ((1 \le y_i \le 10^9)). It is guaranteed that the sum of the values of (n) across all test cases does not exceed (2 \cdot 10^5). For each test case, output a single integer on a separate line — the minimum time required for pizza delivery. Consider the second test case: Move from the point ((Ax, Ay)) to the point ((x_3, y_3)) in (4) seconds. Move from the point ((x_3, y_3)) to the point ((x_1, y_1)) in (4) sec

Tutorials

Разбор Codeforces Round 1076 (Div. 3)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
359918154 pedropiin F Jan. 25, 2026, 9:17 p.m. OK C++17 (GCC 7-32) TESTS 6 125 0
359915861 UpperHand F Jan. 25, 2026, 8:43 p.m. OK C++17 (GCC 7-32) TESTS 6 125 0
359945175 tomQian F Jan. 26, 2026, 6:01 a.m. OK C++17 (GCC 7-32) TESTS 14 125 4300800
359886222 30andrei F Jan. 25, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 6 125 5734400
359922382 winbow13 F Jan. 25, 2026, 10:51 p.m. OK C++17 (GCC 7-32) TESTS 6 125 6144000
359937998 Sumits_0803 F Jan. 26, 2026, 4:50 a.m. OK C++17 (GCC 7-32) TESTS 6 140 0
359937380 hem880 F Jan. 26, 2026, 4:43 a.m. OK C++17 (GCC 7-32) TESTS 6 140 0
359916922 UpperHand F Jan. 25, 2026, 8:58 p.m. OK C++17 (GCC 7-32) TESTS 6 140 0
359886275 Dyaa.Bai F Jan. 25, 2026, 4:49 p.m. OK C++17 (GCC 7-32) TESTS 6 140 0
359919413 not_not_miky F Jan. 25, 2026, 9:42 p.m. OK C++17 (GCC 7-32) TESTS 6 140 102400
359887657 flying_saucer F Jan. 25, 2026, 4:56 p.m. OK C++20 (GCC 13-64) TESTS 6 93 921600
359935110 drogbaaaa F Jan. 26, 2026, 4:11 a.m. OK C++20 (GCC 13-64) TESTS 6 93 1228800
359890609 UltimateAAJ F Jan. 25, 2026, 5:18 p.m. OK C++20 (GCC 13-64) TESTS 6 93 1945600
359929074 gazali F Jan. 26, 2026, 2:15 a.m. OK C++20 (GCC 13-64) TESTS 6 93 8806400
359931857 Rookie_MIN F Jan. 26, 2026, 3:13 a.m. OK C++20 (GCC 13-64) TESTS 6 93 9932800
359886443 200kg_BurgerPeek F Jan. 25, 2026, 4:49 p.m. OK C++20 (GCC 13-64) TESTS 6 93 16076800
359885448 saumya F Jan. 25, 2026, 4:48 p.m. OK C++20 (GCC 13-64) TESTS 6 109 102400
359911391 zacharychao F Jan. 25, 2026, 7:50 p.m. OK C++20 (GCC 13-64) TESTS 6 109 921600
359896288 LuOsIer F Jan. 25, 2026, 5:48 p.m. OK C++20 (GCC 13-64) TESTS 6 109 1638400
359897935 ztglp666 F Jan. 25, 2026, 5:58 p.m. OK C++20 (GCC 13-64) TESTS 6 109 2560000
359894893 fywoooo F Jan. 25, 2026, 5:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 78 11264000
359883469 HappyMonk F Jan. 25, 2026, 4:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 93 8908800
359912165 bonopo F Jan. 25, 2026, 8 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 93 9625600
359936191 Adarsh1805 F Jan. 26, 2026, 4:27 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 0
359931387 xiaogan881 F Jan. 26, 2026, 3:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 0
359906611 Saif_Ahmed008 F Jan. 25, 2026, 7:01 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 102400
359885242 Mot_sem F Jan. 25, 2026, 4:48 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 102400
359883462 olff F Jan. 25, 2026, 4:46 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 102400
359883241 JacquesCavallier F Jan. 25, 2026, 4:45 p.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 1740800
359937265 starflowrain F Jan. 26, 2026, 4:41 a.m. OK C++23 (GCC 14-64, msys2) TESTS 6 109 2150400
359935547 ruban F Jan. 26, 2026, 4:17 a.m. OK FPC TESTS 6 234 223846400
359923227 NenadDapic F Jan. 25, 2026, 11:14 p.m. OK FPC TESTS 6 546 19763200
359886527 suryatejauppala F Jan. 25, 2026, 4:49 p.m. OK GNU C11 TESTS 6 125 1536000
359887906 actualtsg F Jan. 25, 2026, 4:58 p.m. OK GNU C11 TESTS 6 125 1740800
359912941 1435730 F Jan. 25, 2026, 8:08 p.m. OK GNU C11 TESTS 6 140 1536000
359886484 neony1027 F Jan. 25, 2026, 4:49 p.m. OK GNU C11 TESTS 6 140 3174400
359885681 Vedant87 F Jan. 25, 2026, 4:48 p.m. OK Java 21 TESTS 6 203 3584000
359884149 codecurser F Jan. 25, 2026, 4:47 p.m. OK Java 21 TESTS 6 296 14438400
359886140 D_Anand_2005 F Jan. 25, 2026, 4:49 p.m. OK Java 21 TESTS 6 437 17305600
359891363 ashyx F Jan. 25, 2026, 5:21 p.m. OK Java 21 TESTS 6 453 8601600
359920154 pranp_24 F Jan. 25, 2026, 9:57 p.m. OK Java 21 TESTS 6 453 13926400
359926399 SoHxM2K F Jan. 26, 2026, 1:02 a.m. OK Java 21 TESTS 6 468 13107200
359896099 shiveshe F Jan. 25, 2026, 5:47 p.m. OK Java 21 TESTS 6 500 15872000
359938986 godAngryOver F Jan. 26, 2026, 5:02 a.m. OK Java 21 TESTS 6 500 21196800
359884001 tushar19280 F Jan. 25, 2026, 4:46 p.m. OK Java 21 TESTS 6 562 84992000
359911363 I_AM_SPEED F Jan. 25, 2026, 7:50 p.m. OK Java 21 TESTS 6 578 43724800
359906252 yadavshivansh849 F Jan. 25, 2026, 6:58 p.m. OK Java 8 TESTS 6 281 19148800
359887314 Nitish15 F Jan. 25, 2026, 4:53 p.m. OK Java 8 TESTS 6 421 22630400
359940138 am_I_Newbie F Jan. 26, 2026, 5:15 a.m. OK Java 8 TESTS 6 734 102400
359901308 Mr.Curious F Jan. 25, 2026, 6:20 p.m. OK Java 8 TESTS 6 1250 59084800
359902609 jayrajderasari F Jan. 25, 2026, 6:29 p.m. OK PyPy 3 TESTS 6 921 22937600
359896529 crucious F Jan. 25, 2026, 5:50 p.m. OK PyPy 3 TESTS 6 1171 24985600
359884589 DrCombinatorics F Jan. 25, 2026, 4:47 p.m. OK PyPy 3 TESTS 6 1187 21913600
359884467 lushfeast F Jan. 25, 2026, 4:47 p.m. OK PyPy 3 TESTS 6 1343 28364800
359909823 kikjeck F Jan. 25, 2026, 7:31 p.m. OK PyPy 3 TESTS 6 1515 22425600
359898705 last_theorem F Jan. 25, 2026, 6:03 p.m. OK PyPy 3-64 TESTS 6 250 37990400
359931008 kamio-misuzu F Jan. 26, 2026, 2:55 a.m. OK PyPy 3-64 TESTS 6 265 35737600
359932471 abhinavkumarrath F Jan. 26, 2026, 3:24 a.m. OK PyPy 3-64 TESTS 6 296 33996800
359930946 kamio-misuzu F Jan. 26, 2026, 2:54 a.m. OK PyPy 3-64 TESTS 6 296 35430400
359922641 Alois F Jan. 25, 2026, 10:58 p.m. OK PyPy 3-64 TESTS 6 343 36352000
359883238 jubaO F Jan. 25, 2026, 4:45 p.m. OK PyPy 3-64 TESTS 6 359 36966400
359918813 s_a_dwivedi F Jan. 25, 2026, 9:30 p.m. OK PyPy 3-64 TESTS 6 359 58982400
359900780 vxgmichel F Jan. 25, 2026, 6:16 p.m. OK PyPy 3-64 TESTS 6 390 33382400
359903626 1ncinerate F Jan. 25, 2026, 6:36 p.m. OK PyPy 3-64 TESTS 6 390 33894400
359886044 SubZero2903 F Jan. 25, 2026, 4:49 p.m. OK PyPy 3-64 TESTS 6 406 49766400
359886423 mishradarsh18 F Jan. 25, 2026, 4:49 p.m. OK Python 3 TESTS 6 453 35123200
359899615 khantnandeesh3205 F Jan. 25, 2026, 6:09 p.m. OK Python 3 TESTS 6 562 66969600
359885645 AkashSomasundaram F Jan. 25, 2026, 4:48 p.m. OK Python 3 TESTS 6 578 34611200
359900602 khantnandeesh3205 F Jan. 25, 2026, 6:15 p.m. OK Python 3 TESTS 6 609 63897600
359885173 IshaanS0808 F Jan. 25, 2026, 4:48 p.m. OK Python 3 TESTS 6 750 36147200
359888998 Icement F Jan. 25, 2026, 5:06 p.m. OK Python 3 TESTS 6 843 58777600
359884283 yahyakatif42 F Jan. 25, 2026, 4:47 p.m. OK Python 3 TESTS 6 1015 65331200
359903360 allenchang2001 F Jan. 25, 2026, 6:34 p.m. OK Rust 2021 TESTS 6 93 11776000
359895830 son_small_hands F Jan. 25, 2026, 5:45 p.m. OK Rust 2024 TESTS 6 62 16076800
359883660 tryingoutcp F Jan. 25, 2026, 4:46 p.m. OK Rust 2024 TESTS 6 109 9728000

remove filters

Back to search problems