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 |
|---|---|---|---|---|---|---|
| 2171 | Codeforces Round 1065 (Div. 3) | FINISHED | False | 9000 | 12756323 | Nov. 20, 2025, 2:35 p.m. |
Solved |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
|---|---|---|---|---|---|---|
| ( 2292 ) | G | Sakura Adachi and Optimal Sequences | PROGRAMMING | bitmasks combinatorics greedy math |
Adachi is in the middle of a generational crashout... over, uh, this problem! Yep, that's definitely it... anyways, please help her solve it! You are given two arrays (a) and (b) of length (n) ((1\leq a_i\leq b_i)). In one operation, you may either: choose an index (i) ((1\leq i\leq n)) and set (a_i := a_i + 1), or double all elements of (a). Let (x) denote the minimum number of operations needed to make (a = b). Two arrays (a) and (b) of length (n) are considered equal if (a_i = b_i) for all (1\leq i\leq n). Find the value of (x). Additionally, count the number of sequences of operations that make (a = b) using exactly (x) operations. Two such sequences of operations are considered different if, for any (1\leq j\leq x), the (j)-th operation of each sequence differs (either in the type of operation selected or the index chosen, if applicable). Since the number of sequences may be large, output it modulo ({\color{red}{10^6+3}}). Note that (10^6+3) is a prime number. The first line contains a single integer (t) ((1\leq t\leq 10^4)) — the number of test cases. The first line of each test case contains a single integer (n) ((2\leq n\leq 2\cdot 10^5)). The second line of each test case contains (n) integers, (a_1, a_2, \dots, a_n) ((1\leq a_i\leq 10^6)). The third line of each test case contains (n) integers, (b_1, b_2, \dots, b_n) ((a_i\leq b_i\leq 10^6)). It is guaranteed that the sum of (n) over all test cases does not exceed (2\cdot 10^5). For each test case, output two integers, the value of (x), and the number of sequences of operations that make (a = b) using exactly (x) operations, modulo (10^6+3). The value of (x) should be printed exactly; that is, it should not be taken modulo (10^6 + 3). In the second sample, it is possible to convert (a) into (b) using only three operations. There is |
| Codeforces Round 1065 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
|---|---|---|---|---|---|---|---|---|---|---|---|
| 350013753 | Eterna | G | Nov. 21, 2025, 3:33 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 140 | 28979200 | ||
| 350013872 | Eterna | G | Nov. 21, 2025, 3:35 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 155 | 28979200 | ||
| 350047471 | infikei | G | Nov. 21, 2025, 10:04 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 156 | 9625600 | ||
| 350053106 | little_happy | G | Nov. 21, 2025, 10:56 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 156 | 15257600 | ||
| 349997342 | -adhd- | G | Nov. 20, 2025, 9:26 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 186 | 8089600 | ||
| 350061885 | Moya_Rao | G | Nov. 21, 2025, 12:08 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 186 | 20889600 | ||
| 350048732 | bubbarob19 | G | Nov. 21, 2025, 10:15 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 202 | 6553600 | ||
| 350106051 | Euthymia | G | Nov. 21, 2025, 5:40 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 202 | 7987200 | ||
| 350139799 | Westin_sheep | G | Nov. 22, 2025, 2:06 a.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 202 | 47411200 | ||
| 350082722 | SakiRyozo | G | Nov. 21, 2025, 2:47 p.m. | OK | C++17 (GCC 7-32) | TESTS | 18 | 203 | 8908800 | ||
| 350009959 | antguz | G | Nov. 21, 2025, 2:32 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 124 | 5632000 | ||
| 350003770 | antguz | G | Nov. 21, 2025, 12:05 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 124 | 5632000 | ||
| 350095260 | StoneXie | G | Nov. 21, 2025, 4:16 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 124 | 6451200 | ||
| 350040232 | Dedust | G | Nov. 21, 2025, 9:08 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 124 | 7987200 | ||
| 350008923 | Muschuang123 | G | Nov. 21, 2025, 2:13 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 124 | 16076800 | ||
| 350000649 | lucasma8795 | G | Nov. 20, 2025, 10:31 p.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 140 | 3993600 | ||
| 350151292 | DuGuJH | G | Nov. 22, 2025, 5:31 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 140 | 12800000 | ||
| 350153265 | DGH_Didi | G | Nov. 22, 2025, 5:54 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 140 | 14540800 | ||
| 350152717 | DGH_Didi | G | Nov. 22, 2025, 5:48 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 140 | 14540800 | ||
| 350017996 | Prahasith_Pasnoor | G | Nov. 21, 2025, 4:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 18 | 140 | 15360000 | ||
| 350072012 | J_A_I_KUMAR | G | Nov. 21, 2025, 1:28 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 7987200 | ||
| 350008218 | quangminh98 | G | Nov. 21, 2025, 1:59 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 7987200 | ||
| 349992132 | H1manshuSingh | G | Nov. 20, 2025, 8:13 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 7987200 | ||
| 350151806 | ToMuchTNT | G | Nov. 22, 2025, 5:37 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 8806400 | ||
| 350146197 | _akasi | G | Nov. 22, 2025, 4:13 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 15462400 | ||
| 350140403 | cankjaca | G | Nov. 22, 2025, 2:19 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 16076800 | ||
| 350005578 | GeometryFeng | G | Nov. 21, 2025, 12:59 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 16076800 | ||
| 350004561 | abcd_4321 | G | Nov. 21, 2025, 12:30 a.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 124 | 20070400 | ||
| 350071690 | EL_BALD | G | Nov. 21, 2025, 1:26 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 125 | 7987200 | ||
| 350134122 | espacio | G | Nov. 21, 2025, 11:24 p.m. | OK | C++23 (GCC 14-64, msys2) | TESTS | 18 | 125 | 17100800 | ||
| 350134922 | gxlois | G | Nov. 21, 2025, 11:50 p.m. | OK | D | TESTS | 18 | 327 | 63692800 | ||
| 350136862 | gxlois | G | Nov. 22, 2025, 12:55 a.m. | OK | D | TESTS | 18 | 390 | 63795200 | ||
| 350137043 | gxlois | G | Nov. 22, 2025, 1:01 a.m. | OK | D | TESTS | 18 | 421 | 63692800 | ||
| 350137023 | gxlois | G | Nov. 22, 2025, 1 a.m. | OK | D | TESTS | 18 | 421 | 63692800 | ||
| 350136978 | gxlois | G | Nov. 22, 2025, 12:59 a.m. | OK | D | TESTS | 18 | 436 | 63692800 | ||
| 350050188 | MainAgain | G | Nov. 21, 2025, 10:28 a.m. | OK | Go | TESTS | 18 | 202 | 57344000 | ||
| 350053274 | 0x3F | G | Nov. 21, 2025, 10:58 a.m. | OK | Go | TESTS | 18 | 296 | 14233600 | ||
| 350146113 | uttaran_das | G | Nov. 22, 2025, 4:12 a.m. | OK | Java 21 | TESTS | 18 | 531 | 38912000 | ||
| 350145849 | uttaran_das | G | Nov. 22, 2025, 4:07 a.m. | OK | Java 21 | TESTS | 18 | 577 | 52428800 | ||
| 350012370 | yang_wei | G | Nov. 21, 2025, 3:13 a.m. | OK | Java 21 | TESTS | 18 | 593 | 23961600 | ||
| 350061915 | practiceAccount257 | G | Nov. 21, 2025, 12:08 p.m. | OK | Java 21 | TESTS | 18 | 734 | 21606400 | ||
| 350067751 | xmjlove | G | Nov. 21, 2025, 12:55 p.m. | OK | Java 8 | TESTS | 18 | 608 | 7270400 | ||
| 350084966 | kevin_0911 | G | Nov. 21, 2025, 3:03 p.m. | OK | Java 8 | TESTS | 18 | 749 | 16793600 | ||
| 350118604 | SoleProprietor | G | Nov. 21, 2025, 7:23 p.m. | OK | PyPy 3-64 | TESTS | 18 | 265 | 72396800 | ||
| 350012904 | Emikooh | G | Nov. 21, 2025, 3:21 a.m. | OK | PyPy 3-64 | TESTS | 18 | 296 | 52633600 | ||
| 350079563 | PVHKReddy | G | Nov. 21, 2025, 2:23 p.m. | OK | PyPy 3-64 | TESTS | 18 | 311 | 61132800 | ||
| 350052690 | DeadMan69 | G | Nov. 21, 2025, 10:53 a.m. | OK | PyPy 3-64 | TESTS | 18 | 327 | 58265600 | ||
| 350042922 | L-S-S | G | Nov. 21, 2025, 9:28 a.m. | OK | PyPy 3-64 | TESTS | 18 | 343 | 50073600 | ||
| 350008419 | VaHiX | G | Nov. 21, 2025, 2:03 a.m. | OK | PyPy 3-64 | TESTS | 18 | 405 | 45056000 | ||
| 350036778 | Pain328 | G | Nov. 21, 2025, 8:41 a.m. | OK | PyPy 3-64 | TESTS | 18 | 405 | 52428800 | ||
| 350091747 | HumbleRobo | G | Nov. 21, 2025, 3:51 p.m. | OK | PyPy 3-64 | TESTS | 18 | 406 | 70246400 | ||
| 350035224 | detteiuu | G | Nov. 21, 2025, 8:27 a.m. | OK | PyPy 3-64 | TESTS | 18 | 421 | 63180800 | ||
| 349999255 | czjnbb | G | Nov. 20, 2025, 10:01 p.m. | OK | PyPy 3-64 | TESTS | 18 | 421 | 78848000 | ||
| 350070719 | siam__007 | G | Nov. 21, 2025, 1:18 p.m. | OK | Python 3 | TESTS | 18 | 1468 | 82636800 |
Back to search problems