Codeforces Round 1062 (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
2167 Codeforces Round 1062 (Div. 4) FINISHED False 8100 14743523 Oct. 28, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 8987 ) E khba Loves to Sleep! PROGRAMMING binary search data structures geometry implementation math

Khba has (n) friends, each standing on a line at position (a_i), and each of them is in the range (0, x). They all want to come to him. One of his friends, Isamatdin, gave him (k) teleports. Each friend will walk to the nearest teleport (choosing the shortest distance). Once a friend reaches a teleport, khba and the friend can instantly meet. But khba is so tired that he'll be sleeping while his friends are walking toward him. Now he wants to choose (k) teleport positions so that their positions are distinct and lie within the range (0, x), in order to maximize the time it takes for the first friend who reaches a teleport to reach it. Assume that friends move at the same speed. Since khba isn't good at calculations, you should output the (k) chosen teleport positions. Each test contains multiple test cases. The first line contains a single integer (t) ((1 \leq t \leq 10^4)) — the number of test cases. The description of the test cases follows. The first line of each test case contains three integers (n), (k), and (x) ((1 \leq n, k \leq 2 \cdot 10^5), (k - 1 \leq x \leq 10^9)) — the number of friends, the number of teleports, and the range of possible positions for the teleports. The second line of each test case contains (n) integers (a_1, a_2, \dots, a_n) ((0 \leq a_i \leq x)) — the positions of khba's friends. It is guaranteed that the sum of (n) over all test cases does not exceed (2 \cdot 10^5). It is guaranteed that the sum of (k) over all test cases does not exceed (2 \cdot 10^5). For each test case, output a single line containing (k) integers — the (k) chosen teleport positions. The positions must be distinct and lie within the range (0, x). The positions may be output in any order. If there are multiple optimal choices, output any of them. Sample 1. Friends at positions (1,0,2,4). Chosen teleport position: (3). Nearest teleport for eac

Tutorials

Arpa Video Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
346502566 huyennkai E Oct. 29, 2025, 4:52 p.m. OK C++17 (GCC 7-32) TESTS 14 109 0
346530560 agamGK1 E Oct. 29, 2025, 8:03 p.m. OK C++17 (GCC 7-32) TESTS 14 124 0
346427598 521111 E Oct. 29, 2025, 7:45 a.m. OK C++17 (GCC 7-32) TESTS 14 124 0
346409196 ustcyyw E Oct. 29, 2025, 4:35 a.m. OK C++17 (GCC 7-32) TESTS 14 124 819200
346395275 Nguyen52 E Oct. 29, 2025, 12:45 a.m. OK C++17 (GCC 7-32) TESTS 14 124 819200
346561872 Prajak_Sen E Oct. 30, 2025, 4:07 a.m. OK C++17 (GCC 7-32) TESTS 14 124 1638400
346561811 maoqingyang E Oct. 30, 2025, 4:06 a.m. OK C++17 (GCC 7-32) TESTS 14 124 1638400
346561691 maoqingyang E Oct. 30, 2025, 4:05 a.m. OK C++17 (GCC 7-32) TESTS 14 124 1638400
346545668 stariverony E Oct. 30, 2025, 12:34 a.m. OK C++17 (GCC 7-32) TESTS 14 125 0
346569883 gaialimi E Oct. 30, 2025, 5:22 a.m. OK C++17 (GCC 7-32) TESTS 14 125 819200
346557860 _andyli E Oct. 30, 2025, 3:18 a.m. OK C++20 (GCC 13-64) TESTS 14 77 2150400
346565397 athiest07 E Oct. 30, 2025, 4:35 a.m. OK C++20 (GCC 13-64) TESTS 14 93 0
346562497 zyc_ovo E Oct. 30, 2025, 4:15 a.m. OK C++20 (GCC 13-64) TESTS 14 93 0
346506591 arodnap33 E Oct. 29, 2025, 5:08 p.m. OK C++20 (GCC 13-64) TESTS 14 93 0
346525329 Thorfin_ll E Oct. 29, 2025, 7:13 p.m. OK C++20 (GCC 13-64) TESTS 14 108 0
346434318 AthJa E Oct. 29, 2025, 8:43 a.m. OK C++20 (GCC 13-64) TESTS 14 108 0
346524520 tanishq2507 E Oct. 29, 2025, 7:06 p.m. OK C++20 (GCC 13-64) TESTS 14 108 102400
346395059 YFffffffff E Oct. 29, 2025, 12:39 a.m. OK C++20 (GCC 13-64) TESTS 14 108 102400
346379102 ezwithgpt E Oct. 28, 2025, 8:06 p.m. OK C++20 (GCC 13-64) TESTS 14 108 102400
346569255 Shahidtk E Oct. 30, 2025, 5:17 a.m. OK C++20 (GCC 13-64) TESTS 14 108 1945600
346568226 iliyian E Oct. 30, 2025, 5:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 93 0
346549879 ctw123 E Oct. 30, 2025, 1:55 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 93 0
346411688 bluish E Oct. 29, 2025, 5:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 93 307200
346488041 wen-rou-de-xiang-ni-baba E Oct. 29, 2025, 3:27 p.m. OK C++23 (GCC 14-64, msys2) TESTS 14 93 2048000
346564295 you-jin-plus E Oct. 30, 2025, 4:22 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 108 0
346549302 OTTFF E Oct. 30, 2025, 1:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 108 0
346521438 gramathegod E Oct. 29, 2025, 6:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 14 108 0
346504761 Dev0211 E Oct. 29, 2025, 4:57 p.m. OK C++23 (GCC 14-64, msys2) TESTS 14 108 0
346395526 fatespeaker E Oct. 29, 2025, 12:52 a.m. OK C++23 (GCC 14-64, msys2) TESTS 14 108 0
346392785 amr_abdelazim E Oct. 28, 2025, 11:29 p.m. OK C++23 (GCC 14-64, msys2) TESTS 14 108 0
346507855 VaHiX E Oct. 29, 2025, 5:15 p.m. OK Java 21 TESTS 14 327 1433600
346399442 ccj123 E Oct. 29, 2025, 2:17 a.m. OK Java 21 TESTS 14 358 1638400
346499387 klu2300030753 E Oct. 29, 2025, 4:33 p.m. OK Java 21 TESTS 14 390 14233600
346397277 skynet_07 E Oct. 29, 2025, 1:32 a.m. OK Java 21 TESTS 14 405 1024000
346531905 TriptiChaurasia E Oct. 29, 2025, 8:17 p.m. OK Java 21 TESTS 14 421 7987200
346547590 man-ray E Oct. 30, 2025, 1:12 a.m. OK Java 21 TESTS 14 436 8704000
346408881 jindal2004keshav E Oct. 29, 2025, 4:31 a.m. OK Java 21 TESTS 14 452 20992000
346395929 dzhi E Oct. 29, 2025, 1:02 a.m. OK Java 21 TESTS 14 483 9113600
346411864 tekka_ity E Oct. 29, 2025, 5:07 a.m. OK Java 21 TESTS 14 608 27545600
346492140 GuLLu05 E Oct. 29, 2025, 3:51 p.m. OK Java 21 TESTS 14 671 8294400
346531953 NavneetKumar123 E Oct. 29, 2025, 8:17 p.m. OK Java 8 TESTS 14 327 5017600
346569618 prime29 E Oct. 30, 2025, 5:20 a.m. OK Java 8 TESTS 14 374 5324800
346549630 NeelmaniPandey09 E Oct. 30, 2025, 1:51 a.m. OK Java 8 TESTS 14 609 5222400
346546186 lupunish E Oct. 30, 2025, 12:45 a.m. OK Java 8 TESTS 14 639 25497600
346523825 KLU2300033802 E Oct. 29, 2025, 7 p.m. OK Java 8 TESTS 14 780 0
346379652 Shashwata_32 E Oct. 28, 2025, 8:12 p.m. OK Java 8 TESTS 14 1577 98201600
346514157 L-S-S E Oct. 29, 2025, 5:52 p.m. OK Kotlin 2.2 TESTS 14 515 17612800
346507372 VaHiX E Oct. 29, 2025, 5:13 p.m. OK Kotlin 2.2 TESTS 14 624 19660800
346488158 chinesedfan E Oct. 29, 2025, 3:27 p.m. OK Node.js TESTS 14 671 99635200
346524146 dglima E Oct. 29, 2025, 7:02 p.m. OK Node.js TESTS 14 1312 88985600
346388142 quantiset E Oct. 28, 2025, 9:57 p.m. OK PyPy 3 TESTS 14 718 19251200
346527746 aslammgaied E Oct. 29, 2025, 7:36 p.m. OK PyPy 3 TESTS 14 1281 21708800
346533484 anaghninja432 E Oct. 29, 2025, 8:35 p.m. OK PyPy 3-64 TESTS 14 250 29491200
346505031 zzz_._nitin E Oct. 29, 2025, 4:59 p.m. OK PyPy 3-64 TESTS 14 296 32972800
346517244 VaHiX E Oct. 29, 2025, 6:12 p.m. OK PyPy 3-64 TESTS 14 327 27238400
346537939 eugenekoran E Oct. 29, 2025, 9:42 p.m. OK PyPy 3-64 TESTS 14 327 30617600
346409690 HumbleRobo E Oct. 29, 2025, 4:41 a.m. OK PyPy 3-64 TESTS 14 342 35020800
346538493 eugenekoran E Oct. 29, 2025, 9:53 p.m. OK PyPy 3-64 TESTS 14 358 30617600
346420544 hundunlilun1 E Oct. 29, 2025, 6:40 a.m. OK PyPy 3-64 TESTS 14 359 35635200
346397426 yoonsica E Oct. 29, 2025, 1:36 a.m. OK PyPy 3-64 TESTS 14 389 32358400
346561727 SirMrGuy E Oct. 30, 2025, 4:05 a.m. OK PyPy 3-64 TESTS 14 390 28979200
346488354 aashika_j E Oct. 29, 2025, 3:28 p.m. OK PyPy 3-64 TESTS 14 405 23142400
346494082 SGrade E Oct. 29, 2025, 4:02 p.m. OK Python 3 TESTS 14 1406 51302400
346405776 adipuli__2004 E Oct. 29, 2025, 3:50 a.m. OK Python 3 TESTS 14 2093 26931200
346546274 Andrew1234567890 E Oct. 30, 2025, 12:47 a.m. OK Python 3 TESTS 14 2280 26726400
346391384 0x81 E Oct. 28, 2025, 10:44 p.m. OK Rust 2024 TESTS 14 109 4710400
346394011 0x81 E Oct. 29, 2025, 12:09 a.m. OK Rust 2024 TESTS 14 109 5529600
346393696 0x81 E Oct. 28, 2025, 11:59 p.m. OK Rust 2024 TESTS 14 109 5529600

remove filters

Back to search problems