Good Bye 2024: 2025 is NEAR

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
2053 Good Bye 2024: 2025 is NEAR FINISHED False 10800 41009123 Dec. 28, 2024, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 12294 ) C Bewitching Stargazer PROGRAMMING bitmasks divide and conquer dp math

Iris looked at the stars and a beautiful problem emerged in her mind. She is inviting you to solve it so that a meteor shower is believed to form. There are (n) stars in the sky, arranged in a row. Iris has a telescope, which she uses to look at the stars. Initially, Iris observes stars in the segment (1, n), and she has a lucky value of (0). Iris wants to look for the star in the middle position for each segment (l, r) that she observes. So the following recursive procedure is used: First, she will calculate (m = \left\lfloor \frac{l+r}{2} \right\rfloor). If the length of the segment (i.e. (r - l + 1)) is even, Iris will divide it into two equally long segments (l, m) and (m+1, r) for further observation. Otherwise, Iris will aim the telescope at star (m), and her lucky value will increase by (m); subsequently, if (l \neq r), Iris will continue to observe two segments (l, m-1) and (m+1, r). Iris is a bit lazy. She defines her laziness by an integer (k): as the observation progresses, she will not continue to observe any segment (l, r) with a length strictly less than (k). In this case, please predict her final lucky value . Each test contains multiple test cases. The first line of input contains a single integer (t) ((1 \leq t \leq 10^5)) — the number of test cases. The description of test cases follows. The only line of each test case contains two integers (n) and (k) ((1 \leq k \leq n \leq 2\cdot 10^9)). For each test case, output a single integer — the final lucky value . In the first test case, at the beginning, Iris observes (1, 7). Since (1, 7) has an odd length, she aims at star (4) and therefore increases her lucky value by (4). Then it is split into (2) new segments: (1, 3) and (5, 7). The segment (1, 3) again has an odd length, so Iris aims at star (2) and increases her lucky value by (2). Then it is

Tutorials

Good Bye 2024: 2025 is NEAR Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
298912149 petrenslavik C Dec. 28, 2024, 11:37 p.m. OK C# 10 TESTS 10 124 3584000
298889842 og.kostya C Dec. 28, 2024, 5:30 p.m. OK C# 10 TESTS 10 171 2969600
298887257 khamaza C Dec. 28, 2024, 5:21 p.m. OK C# 10 TESTS 10 358 3174400
298876211 sun_jinwoo36 C Dec. 28, 2024, 4:42 p.m. OK C# 10 TESTS 10 374 2969600
298882374 petrenslavik C Dec. 28, 2024, 5:03 p.m. OK C# 10 TESTS 10 967 3174400
298923701 Dark_Soul_06 C Dec. 29, 2024, 5:09 a.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298923677 MadCoder031 C Dec. 29, 2024, 5:08 a.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298923594 G-DFS-CP-NEW-1 C Dec. 29, 2024, 5:07 a.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298909622 OIerGegu1019 C Dec. 28, 2024, 10:12 p.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298901126 JorgeMartinez C Dec. 28, 2024, 7:35 p.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298887430 asdfgh0986 C Dec. 28, 2024, 5:21 p.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298876637 gs07 C Dec. 28, 2024, 4:43 p.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298875564 Ahmed05 C Dec. 28, 2024, 4:40 p.m. OK C++17 (GCC 7-32) TESTS 10 124 0
298922252 Rafat_Kabir C Dec. 29, 2024, 4:40 a.m. OK C++17 (GCC 7-32) TESTS 10 124 102400
298917774 leowjh C Dec. 29, 2024, 2:54 a.m. OK C++17 (GCC 7-32) TESTS 10 124 102400
298923609 dipeshpatidar C Dec. 29, 2024, 5:07 a.m. OK C++20 (GCC 13-64) TESTS 10 77 0
298920848 xXxNoobSaibotxXx C Dec. 29, 2024, 4:08 a.m. OK C++20 (GCC 13-64) TESTS 10 77 0
298916069 weirdflexbutok C Dec. 29, 2024, 2:06 a.m. OK C++20 (GCC 13-64) TESTS 10 77 0
298882264 ssldft C Dec. 28, 2024, 5:02 p.m. OK C++20 (GCC 13-64) TESTS 10 77 0
298927384 www_bilibili_com C Dec. 29, 2024, 6:07 a.m. OK C++20 (GCC 13-64) TESTS 11 77 102400
298922517 lucky_clover_ C Dec. 29, 2024, 4:46 a.m. OK C++20 (GCC 13-64) TESTS 10 78 0
298920240 Lanly C Dec. 29, 2024, 3:54 a.m. OK C++20 (GCC 13-64) TESTS 10 78 0
298915954 Camilo649 C Dec. 29, 2024, 2:03 a.m. OK C++20 (GCC 13-64) TESTS 10 78 0
298915344 trgao C Dec. 29, 2024, 1:44 a.m. OK C++20 (GCC 13-64) TESTS 10 78 0
298909125 arodnap33 C Dec. 28, 2024, 9:58 p.m. OK C++20 (GCC 13-64) TESTS 10 78 0
298903540 HassanAdel0 C Dec. 28, 2024, 8:11 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 62 102400
298895965 SharifdotG C Dec. 28, 2024, 6:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 102400
298920639 TJLhhhhss C Dec. 29, 2024, 4:03 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 77 1228800
298917058 ando C Dec. 29, 2024, 2:34 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 78 102400
298917373 Krishhna C Dec. 29, 2024, 2:42 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 92 102400
298908534 Senya_24 C Dec. 28, 2024, 9:44 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 92 102400
298875345 Nogaybica C Dec. 28, 2024, 4:39 p.m. OK C++23 (GCC 14-64, msys2) TESTS 10 92 102400
298925867 Mayur_Hirpara C Dec. 29, 2024, 5:45 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 93 0
298923734 Casio-AEQ-120W-1AVDF C Dec. 29, 2024, 5:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 93 0
298921568 waitforme C Dec. 29, 2024, 4:25 a.m. OK C++23 (GCC 14-64, msys2) TESTS 10 93 0
298896249 NenadDapic C Dec. 28, 2024, 6:42 p.m. OK FPC TESTS 10 249 0
298920467 ArminArlert69 C Dec. 29, 2024, 3:59 a.m. OK GNU C11 TESTS 10 530 102400
298902360 atharvatol04 C Dec. 28, 2024, 7:53 p.m. OK GNU C11 TESTS 10 531 102400
298882240 alicia33 C Dec. 28, 2024, 5:02 p.m. OK GNU C11 TESTS 10 561 0
298882017 Omjoshi_7206 C Dec. 28, 2024, 5:01 p.m. OK GNU C11 TESTS 10 577 102400
298877430 wpateekphillepe6978 C Dec. 28, 2024, 4:46 p.m. OK GNU C11 TESTS 10 593 0
298880151 kathanshah743 C Dec. 28, 2024, 4:55 p.m. OK GNU C11 TESTS 10 608 0
298884716 vinayRamola123 C Dec. 28, 2024, 5:11 p.m. OK GNU C11 TESTS 10 609 0
298918476 zhangyujuan C Dec. 29, 2024, 3:13 a.m. OK Go TESTS 10 296 3276800
298927253 dv416 C Dec. 29, 2024, 6:05 a.m. OK Java 21 TESTS 11 327 1536000
298914293 exothermic C Dec. 29, 2024, 1:09 a.m. OK Java 21 TESTS 10 327 42086400
298886039 raito3z C Dec. 28, 2024, 5:16 p.m. OK Java 21 TESTS 10 389 1331200
298883658 DevankSachdeva C Dec. 28, 2024, 5:07 p.m. OK Java 21 TESTS 10 452 512000
298876543 tirthgohil1410 C Dec. 28, 2024, 4:43 p.m. OK Java 21 TESTS 10 452 512000
298886855 ofrastsenre C Dec. 28, 2024, 5:19 p.m. OK Java 21 TESTS 10 452 614400
298903622 exothermic C Dec. 28, 2024, 8:12 p.m. OK Java 21 TESTS 10 452 42291200
298911894 sagbis C Dec. 28, 2024, 11:26 p.m. OK Java 21 TESTS 10 468 614400
298891302 aj_786 C Dec. 28, 2024, 5:34 p.m. OK Java 21 TESTS 10 484 614400
298921965 akshatsaxena552004.ss C Dec. 29, 2024, 4:34 a.m. OK Java 21 TESTS 10 499 921600
298882825 L1419GHT C Dec. 28, 2024, 5:04 p.m. OK Java 8 TESTS 10 265 0
298890459 ahmedhosny2002 C Dec. 28, 2024, 5:32 p.m. OK Java 8 TESTS 10 327 0
298878865 aditya888 C Dec. 28, 2024, 4:50 p.m. OK Java 8 TESTS 10 515 0
298909708 hoffrj C Dec. 28, 2024, 10:14 p.m. OK Java 8 TESTS 10 624 0
298883142 bxalgo022 C Dec. 28, 2024, 5:06 p.m. OK Java 8 TESTS 10 624 0
298907557 kasiru_69 C Dec. 28, 2024, 9:23 p.m. OK Java 8 TESTS 10 796 0
298926658 b1t_exe C Dec. 29, 2024, 5:57 a.m. OK Java 8 TESTS 11 811 0
298904972 average_coder_guy C Dec. 28, 2024, 8:35 p.m. OK Java 8 TESTS 10 812 0
298875978 priyanshu2384chaudhary C Dec. 28, 2024, 4:41 p.m. OK Java 8 TESTS 10 828 0
298886410 yogeshcp013 C Dec. 28, 2024, 5:18 p.m. OK Java 8 TESTS 10 859 0
298887463 TheAnonymousAMGR C Dec. 28, 2024, 5:22 p.m. OK Kotlin 1.7 TESTS 10 1249 82227200
298881428 jagbarrameda C Dec. 28, 2024, 4:59 p.m. OK Kotlin 1.9 TESTS 10 406 204800
298890407 321xponent C Dec. 28, 2024, 5:32 p.m. OK Kotlin 1.9 TESTS 10 765 204800
298884957 Bogdan_Lukomsky C Dec. 28, 2024, 5:12 p.m. OK PascalABC.NET TESTS 10 702 204800
298907761 mythicalrocket C Dec. 28, 2024, 9:27 p.m. OK PyPy 3 TESTS 10 249 9318400
298902386 sultan_salah11 C Dec. 28, 2024, 7:53 p.m. OK PyPy 3 TESTS 10 1124 9625600
298884310 ImagineTime C Dec. 28, 2024, 5:10 p.m. OK PyPy 3 TESTS 10 1202 9830400
298887409 SPARSH_EE1 C Dec. 28, 2024, 5:21 p.m. OK PyPy 3 TESTS 10 1202 11059200
298884705 Nikita_Ushakov C Dec. 28, 2024, 5:11 p.m. OK PyPy 3 TESTS 10 1312 9523200
298888213 bhartigarg C Dec. 28, 2024, 5:24 p.m. OK PyPy 3 TESTS 10 1609 12083200
298880184 najmiddinweb C Dec. 28, 2024, 4:55 p.m. OK PyPy 3 TESTS 10 1999 12185600
298898847 Yedige4 C Dec. 28, 2024, 7:07 p.m. OK PyPy 3-64 TESTS 10 156 8192000
298898764 Yedige4 C Dec. 28, 2024, 7:06 p.m. OK PyPy 3-64 TESTS 10 156 8294400
298904919 daveshub C Dec. 28, 2024, 8:33 p.m. OK PyPy 3-64 TESTS 10 156 8806400
298912257 RobinFromTheHood C Dec. 28, 2024, 11:42 p.m. OK PyPy 3-64 TESTS 10 171 8601600
298895271 Lilpa C Dec. 28, 2024, 6:34 p.m. OK PyPy 3-64 TESTS 10 171 9216000
298913713 scyyyyyyyyyy C Dec. 29, 2024, 12:43 a.m. OK PyPy 3-64 TESTS 10 171 10240000
298896928 Praneethrcls C Dec. 28, 2024, 6:48 p.m. OK PyPy 3-64 TESTS 10 187 8704000
298906433 smilence C Dec. 28, 2024, 9:01 p.m. OK PyPy 3-64 TESTS 10 217 9728000
298917885 young_skywalker_ C Dec. 29, 2024, 2:57 a.m. OK PyPy 3-64 TESTS 10 218 10137600
298878061 pulkit_garg14 C Dec. 28, 2024, 4:48 p.m. OK PyPy 3-64 TESTS 10 233 9932800
298925984 Fine_stu C Dec. 29, 2024, 5:46 a.m. OK Python 3 TESTS 10 1030 0
298898940 Yedige4 C Dec. 28, 2024, 7:08 p.m. OK Python 3 TESTS 10 1280 0
298901666 Cinnam0n C Dec. 28, 2024, 7:43 p.m. OK Python 3 TESTS 10 1311 0
298923749 good_angel C Dec. 29, 2024, 5:09 a.m. OK Python 3 TESTS 10 1343 0
298882796 Sai_uma_sankar C Dec. 28, 2024, 5:04 p.m. OK Python 3 TESTS 10 1483 0
298878742 localcoder C Dec. 28, 2024, 4:50 p.m. OK Python 3 TESTS 10 1531 0
298884392 Preetham98 C Dec. 28, 2024, 5:10 p.m. OK Python 3 TESTS 10 1718 0
298899841 robust_node C Dec. 28, 2024, 7:18 p.m. OK Python 3 TESTS 10 1750 0
298897144 cjoa C Dec. 28, 2024, 6:50 p.m. OK Python 3 TESTS 10 1765 24985600
298890629 Rajat31 C Dec. 28, 2024, 5:32 p.m. OK Python 3 TESTS 10 1812 0
298913074 vstiff C Dec. 29, 2024, 12:15 a.m. OK Rust 2021 TESTS 10 61 512000
298904479 taki_mekhalfa C Dec. 28, 2024, 8:25 p.m. OK Rust 2021 TESTS 10 234 102400
298876346 mfeds C Dec. 28, 2024, 4:42 p.m. OK Rust 2021 TESTS 10 264 0
298879604 dp_123 C Dec. 28, 2024, 4:53 p.m. OK Rust 2021 TESTS 10 530 102400

remove filters

Back to search problems