Codeforces Round 1123 (Div. 2)

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
2267 Codeforces Round 1123 (Div. 2) FINISHED False 8100 833066 Sept. 25, 2026, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 231 ) G New LRT PROGRAMMING dp

A new LRT (light rail transit) has opened in the famous city. It is a train that moves along a straight line. You are given two numbers (n) and (m), and an array (c) consisting of (m) integers. You are at position (0), and you need to get to position (n). If you are at position (i), you can ride the train as follows: Choose a positive integer (x) such that (m\& x = x), where (\&) denotes the bitwise AND operation . Move from position (i) to (i + x), paying (c_x) coins. Each test contains multiple test cases. The first line contains the number of test cases (t) ((1 \le t \le 10^4)). The description of the test cases follows. The first line of each test case contains two integers (n) and (m) ((1\le n, m\lt 2^{20})). The second line of each test case contains (m) integers (c_1, c_2, \ldots, c_m) ((1\le c_i\le 10^9)). It is guaranteed that the sum of (n) and the sum of (m) over all test cases do not exceed (2^{20}). For each test case, output one number — the answer to the problem modulo (10^9 + 7). In the first test case, there are (4) ways to get to position (n): (0\rightarrow 1\rightarrow 2\rightarrow 3). The cost of this trip is (c_1 + c_1 + c_1 = 6). (0\rightarrow 1\rightarrow 3). The cost of this trip is (c_1 + c_2 = 4). (0\rightarrow 2\rightarrow 3). The cost of this trip is (c_2 + c_1 = 4). (0\rightarrow 3). The cost of this trip is (c_3 = 1).

Tutorials

157126

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
392100490 chelly19940412 G Sept. 26, 2026, 1:39 a.m. OK C++17 (GCC 7-32) TESTS 42 531 92672000
392069933 AK_YZY G Sept. 25, 2026, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 42 687 101273600
392069060 bhngupta G Sept. 25, 2026, 4:45 p.m. OK C++17 (GCC 7-32) TESTS 42 718 105369600
392059274 Nours200 G Sept. 25, 2026, 4:17 p.m. OK C++17 (GCC 7-32) TESTS 42 812 109772800
392079835 Sisabel G Sept. 25, 2026, 6:17 p.m. OK C++17 (GCC 7-32) TESTS 42 906 189542400
392070141 jisoofan G Sept. 25, 2026, 4:48 p.m. OK C++17 (GCC 7-32) TESTS 42 953 445440000
392072619 vpiyush171 G Sept. 25, 2026, 5:10 p.m. OK C++17 (GCC 7-32) TESTS 42 1484 12902400
392090210 Nicolo_010 G Sept. 25, 2026, 8:53 p.m. OK C++17 (GCC 7-32) TESTS 42 1546 224870400
392082122 XZ_7 G Sept. 25, 2026, 6:44 p.m. OK C++17 (GCC 7-32) TESTS 42 1671 12902400
392086696 cksharma G Sept. 25, 2026, 7:49 p.m. OK C++20 (GCC 13-64) TESTS 42 218 16896000
392086182 cksharma G Sept. 25, 2026, 7:41 p.m. OK C++20 (GCC 13-64) TESTS 42 281 13004800
392096077 LanceTheDragonTrainer1 G Sept. 26, 2026, 12:01 a.m. OK C++20 (GCC 13-64) TESTS 42 421 105472000
392084154 utpalsen G Sept. 25, 2026, 7:11 p.m. OK C++20 (GCC 13-64) TESTS 42 437 177049600
392072705 OnlyFirst G Sept. 25, 2026, 5:11 p.m. OK C++20 (GCC 13-64) TESTS 42 453 96972800
392080572 17326020824 G Sept. 25, 2026, 6:25 p.m. OK C++20 (GCC 13-64) TESTS 42 468 101171200
392076643 i_DNB G Sept. 25, 2026, 5:45 p.m. OK C++20 (GCC 13-64) TESTS 42 531 185344000
392087776 cksharma G Sept. 25, 2026, 8:08 p.m. OK C++20 (GCC 13-64) TESTS 42 578 33689600
392087719 javanetbeans G Sept. 25, 2026, 8:07 p.m. OK C++20 (GCC 13-64) TESTS 42 578 33689600
392069368 Ayush_Garg235711 G Sept. 25, 2026, 4:46 p.m. OK C++20 (GCC 13-64) TESTS 42 593 197836800
392102498 ankitraj803120 G Sept. 26, 2026, 2:33 a.m. OK C++23 (GCC 14-64, msys2) TESTS 42 156 16896000
392109823 P2441M G Sept. 26, 2026, 4:58 a.m. OK C++23 (GCC 14-64, msys2) TESTS 42 296 8908800
392081205 MIUZ_8569 G Sept. 25, 2026, 6:32 p.m. OK C++23 (GCC 14-64, msys2) TESTS 42 296 13004800
392074362 undecagon G Sept. 25, 2026, 5:23 p.m. OK C++23 (GCC 14-64, msys2) TESTS 42 406 29900800
392102353 ankitraj803120 G Sept. 26, 2026, 2:30 a.m. OK C++23 (GCC 14-64, msys2) TESTS 42 437 21504000
392073450 ckn060497 G Sept. 25, 2026, 5:16 p.m. OK C++23 (GCC 14-64, msys2) TESTS 42 437 101376000
392093057 pranjalwork2602 G Sept. 25, 2026, 10:09 p.m. OK C++23 (GCC 14-64, msys2) TESTS 42 437 185344000
392103820 StartLovelive G Sept. 26, 2026, 3:06 a.m. OK C++23 (GCC 14-64, msys2) TESTS 42 437 189644800
392067201 Abdullah6127 G Sept. 25, 2026, 4:40 p.m. OK C++23 (GCC 14-64, msys2) TESTS 42 468 21504000
392110585 GoGonutSack G Sept. 26, 2026, 5:09 a.m. OK C++23 (GCC 14-64, msys2) TESTS 42 468 101273600
392066116 nnengine G Sept. 25, 2026, 4:37 p.m. OK GNU C11 TESTS 42 781 96768000
392073326 just_checkin G Sept. 25, 2026, 5:15 p.m. OK Java 21 TESTS 42 656 14233600
392061575 techbro815 G Sept. 25, 2026, 4:23 p.m. OK Java 21 TESTS 42 843 238694400
392063684 Pawan_IIIT_01 G Sept. 25, 2026, 4:30 p.m. OK Java 21 TESTS 42 859 138956800
392067817 rahulx1515 G Sept. 25, 2026, 4:42 p.m. OK Java 21 TESTS 42 953 415744000
392065808 adiya26 G Sept. 25, 2026, 4:36 p.m. OK Java 21 TESTS 42 1046 267366400
392108112 kridha_ms_24 G Sept. 26, 2026, 4:31 a.m. OK PyPy 3-64 TESTS 42 859 121344000
392067986 Shohjahon_2007 G Sept. 25, 2026, 4:42 p.m. OK PyPy 3-64 TESTS 42 1343 407756800
392070860 iamRishii G Sept. 25, 2026, 4:49 p.m. OK PyPy 3-64 TESTS 42 1890 134656000

remove filters

Back to search problems