Codeforces Round 941 (Div. 1)

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
1965 Codeforces Round 941 (Div. 1) FINISHED False 7200 22951463 April 27, 2024, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 6991 ) B Missing Subsequence Sum PROGRAMMING bitmasks constructive algorithms greedy number theory 1800

B'You are given two integers n and k . Find a sequence a of non-negative integers of size at most 25 such that the following conditions hold. A sequence b is a subsequence of a if b can be obtained from a by the deletion of several (possibly, zero or all) elements, without changing the order of the remaining elements. For example, [5, 2, 3] is a subsequence of [1, 5, 7, 8, 2, 4, 3] . It can be shown that under the given constraints, a solution always exists. The first line of the input contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of the test cases follows. Each test case consists of a single line containing two integers n and k ( 2 <= n <= 10^6 , 1 <= k <= n ) -- the parameters described above. It is guaranteed that the sum of n over all test cases does not exceed 10^7 . The first line of output for each test case should contain a single integer m ( 1 <= m <= 25 ) -- the size of your chosen sequence. The second line of output for each test case should contain m integers a_i ( 0 <= a_i <= 10^9 ) -- the elements of your chosen sequence. If there are multiple solutions, print any. In the first example, we just need a subsequence that adds up to 1 , but not one that adds up to 2 . So the array a=[1] suffices. In the second example, all elements are greater than k=1 , so no subsequence adds up to 1 . Every other integer between 1 and n is present in the array, so there is a subsequence of size 1 adding up to each of those numbers. '...

Tutorials

Codeforces Round #941 (Div. 1, Div. 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
258561833 x1f0cb32d3_ B April 28, 2024, 12:31 p.m. OK C# 10 TESTS 40 92 1126400 1800
258523017 T_Nady B April 28, 2024, 6:38 a.m. OK C# 10 TESTS 40 109 2764800 1800
258444594 mban259 B April 27, 2024, 3:29 p.m. OK C# 10 TESTS 40 125 1331200 1800
261449022 luogu_bot2 B May 18, 2024, 2:48 a.m. OK C++14 (GCC 6-32) TESTS 42 46 0 1800
261299515 LYY_yyyy B May 17, 2024, 8:29 a.m. OK C++14 (GCC 6-32) TESTS 42 46 0 1800
259941972 YangJJie B May 8, 2024, 2:57 a.m. OK C++14 (GCC 6-32) TESTS 42 46 0 1800
259669153 little_vegetable B May 5, 2024, 6:15 p.m. OK C++14 (GCC 6-32) TESTS 42 46 0 1800
258953914 yyrwlj B May 1, 2024, 2:28 a.m. OK C++14 (GCC 6-32) TESTS 40 46 0 1800
258628756 liuyz11 B April 29, 2024, 1:40 a.m. OK C++14 (GCC 6-32) TESTS 40 46 0 1800
258625504 SimpleCloud B April 29, 2024, 12:10 a.m. OK C++14 (GCC 6-32) TESTS 40 46 0 1800
263631291 WSD33 B June 1, 2024, 12:50 p.m. OK C++14 (GCC 6-32) TESTS 42 46 0 1800
262888890 W.jr. B May 27, 2024, 1:40 p.m. OK C++14 (GCC 6-32) TESTS 42 46 0 1800
258999423 qyzy B May 1, 2024, 11:15 a.m. OK C++14 (GCC 6-32) TESTS 40 46 1638400 1800
260056803 hayoung0_0 B May 9, 2024, 12:28 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
263418714 ghc7hHx B May 31, 2024, 6:05 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
262942717 altgifted B May 28, 2024, 12:51 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
262892769 shenchuan_fan B May 27, 2024, 2:11 p.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
262651983 niloysarker_cs B May 26, 2024, 5:28 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
262326555 hoang1707 B May 24, 2024, 2:54 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
262186660 ZyadFva B May 22, 2024, 7:06 p.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
261951034 Mindeveloped B May 21, 2024, 2:17 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
260877628 stick_cf B May 14, 2024, 4:54 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
259821597 MamaShakuni B May 7, 2024, 3:43 a.m. OK C++17 (GCC 7-32) TESTS 42 46 0 1800
261586739 PMiguelez B May 19, 2024, 12:21 a.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
263675042 kaichisaki B June 1, 2024, 7:26 p.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
262874906 AtSunset B May 27, 2024, 11:54 a.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
262866569 abv3Rpkg B May 27, 2024, 10:48 a.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
262818525 kukuk_kemal B May 27, 2024, 3:31 a.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
262343095 DaBest B May 24, 2024, 6:33 a.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
262179038 daniel14311531 B May 22, 2024, 5:50 p.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
262148174 MikaKoKo B May 22, 2024, 12:52 p.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
261137814 puspendra_09 B May 16, 2024, 4 a.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
260539293 immix B May 11, 2024, 12:59 p.m. OK C++20 (GCC 13-64) TESTS 42 46 0 1800
258438103 Gassa B April 27, 2024, 3:14 p.m. OK D TESTS 40 78 102400 1800
258477807 ruban B April 27, 2024, 6:25 p.m. OK Delphi TESTS 40 1249 13209600 1800
260026952 Alexanderter10 B May 8, 2024, 4:37 p.m. OK FPC TESTS 42 77 3993600 1800
258482599 rainboy B April 27, 2024, 7:11 p.m. OK GNU C11 TESTS 40 124 102400 1800
258436338 chro4896 B April 27, 2024, 3:11 p.m. OK GNU C11 TESTS 40 124 102400 1800
259704090 mg_05 B May 6, 2024, 4:44 a.m. OK GNU C11 TESTS 42 140 102400 1800
258625531 iffatul_anon B April 29, 2024, 12:11 a.m. OK GNU C11 TESTS 40 140 102400 1800
263572460 luogu_bot2 B June 1, 2024, 4:18 a.m. OK Go TESTS 42 62 409600 1800
259580452 ykt836 B May 5, 2024, 3:58 a.m. OK Go TESTS 42 77 1126400 1800
263572315 yiyiyize B June 1, 2024, 4:17 a.m. OK Go TESTS 42 92 307200 1800
258623898 sagbis B April 28, 2024, 11:17 p.m. OK Java 21 TESTS 40 265 1433600 1800
260871660 oneafter B May 14, 2024, 3:18 a.m. OK Java 21 TESTS 42 280 1126400 1800
258503790 oloy B April 28, 2024, 1:57 a.m. OK Java 21 TESTS 40 281 716800 1800
258604126 mohit458 B April 28, 2024, 6:15 p.m. OK Java 21 TESTS 40 296 1331200 1800
258450383 warks B April 27, 2024, 3:45 p.m. OK Java 21 TESTS 40 311 716800 1800
259853900 striver_cp_sheet B May 7, 2024, 9:33 a.m. OK Java 21 TESTS 42 311 1638400 1800
258433896 profchi B April 27, 2024, 3:06 p.m. OK Java 21 TESTS 40 312 819200 1800
259668173 stolis B May 5, 2024, 6:05 p.m. OK Java 21 TESTS 42 327 1331200 1800
259915968 grace.rd.xu B May 7, 2024, 6:24 p.m. OK Java 21 TESTS 42 327 1945600 1800
263496783 saubhagyat_ug_22 B May 31, 2024, 12:28 p.m. OK Java 21 TESTS 42 343 1331200 1800
259375950 Safawt B May 3, 2024, 2:58 p.m. OK Java 8 TESTS 42 171 0 1800
258452252 MagentaCobra B April 27, 2024, 3:50 p.m. OK Java 8 TESTS 40 171 0 1800
258443100 yvbf B April 27, 2024, 3:26 p.m. OK Java 8 TESTS 40 171 0 1800
258482228 kasiru_69 B April 27, 2024, 7:07 p.m. OK Java 8 TESTS 40 186 0 1800
258433500 golions B April 27, 2024, 3:05 p.m. OK Java 8 TESTS 40 186 0 1800
258433093 knightL B April 27, 2024, 3:04 p.m. OK Java 8 TESTS 40 202 0 1800
258432338 SecondThread B April 27, 2024, 3:03 p.m. OK Java 8 TESTS 40 202 39219200 1800
261273716 toLighthouse B May 17, 2024, 4:25 a.m. OK Java 8 TESTS 42 218 0 1800
260197441 guaidaokakaxi B May 10, 2024, 3:23 a.m. OK Java 8 TESTS 42 233 0 1800
260520255 chinatest B May 11, 2024, 9:38 a.m. OK Java 8 TESTS 42 249 0 1800
258425792 bruhopen B April 27, 2024, 2:50 p.m. OK Kotlin 1.7 TESTS 40 515 16588800 1800
258492726 Tlatoani B April 27, 2024, 9:03 p.m. OK Kotlin 1.9 TESTS 40 187 102400 1800
259590028 kotlinm1 B May 5, 2024, 6:12 a.m. OK Kotlin 1.9 TESTS 42 203 102400 1800
258492675 Tlatoani B April 27, 2024, 9:02 p.m. OK Kotlin 1.9 TESTS 40 203 102400 1800
258429376 Tlatoani B April 27, 2024, 2:57 p.m. OK Kotlin 1.9 TESTS 40 203 204800 1800
259859206 is-that-kt B May 7, 2024, 10:22 a.m. OK Kotlin 1.9 TESTS 42 233 102400 1800
258433160 bcollet B April 27, 2024, 3:04 p.m. OK PyPy 2 TESTS 40 187 2969600 1800
261249423 arnavsingh_047 B May 16, 2024, 8:06 p.m. OK PyPy 3 TESTS 42 171 5222400 1800
259829771 ntlarry B May 7, 2024, 5:42 a.m. OK PyPy 3 TESTS 42 187 4300800 1800
262168518 rajstarts35325 B May 22, 2024, 4:19 p.m. OK PyPy 3 TESTS 42 187 5222400 1800
258483808 codicon B April 27, 2024, 7:24 p.m. OK PyPy 3-64 TESTS 40 108 3788800 1800
258503534 padding B April 28, 2024, 1:51 a.m. OK PyPy 3-64 TESTS 40 109 2867200 1800
258445980 misorin B April 27, 2024, 3:33 p.m. OK PyPy 3-64 TESTS 40 124 2355200 1800
258495264 wyjsdpku B April 27, 2024, 9:52 p.m. OK PyPy 3-64 TESTS 40 124 3276800 1800
259700524 VexedVectors101 B May 6, 2024, 3:31 a.m. OK PyPy 3-64 TESTS 42 124 3379200 1800
258516367 Ibrohim0704 B April 28, 2024, 5:05 a.m. OK PyPy 3-64 TESTS 40 124 3379200 1800
258516082 Ibrohim0704 B April 28, 2024, 5 a.m. OK PyPy 3-64 TESTS 40 124 3379200 1800
263576539 thinkphp B June 1, 2024, 5:10 a.m. OK PyPy 3-64 TESTS 42 124 3788800 1800
258528261 Rumors B April 28, 2024, 7:27 a.m. OK PyPy 3-64 TESTS 40 124 3891200 1800
258446893 yupooh B April 27, 2024, 3:35 p.m. OK PyPy 3-64 TESTS 40 125 4096000 1800
258451300 Jimanbanashi B April 27, 2024, 3:47 p.m. OK Python 2 TESTS 40 109 0 1800
261241927 lzw75 B May 16, 2024, 6:36 p.m. OK Python 3 TESTS 42 77 0 1800
263505157 gmanasa B May 31, 2024, 1:31 p.m. OK Python 3 TESTS 42 93 0 1800
262423283 NS3081992 B May 24, 2024, 6:03 p.m. OK Python 3 TESTS 42 93 0 1800
261520893 daksh2021 B May 18, 2024, 11:19 a.m. OK Python 3 TESTS 42 93 0 1800
259656092 _-Mikasa-_ B May 5, 2024, 4:04 p.m. OK Python 3 TESTS 42 93 0 1800
259339363 quochungbuile B May 3, 2024, 9:55 a.m. OK Python 3 TESTS 42 93 0 1800
259264722 Vedant_Borkar B May 2, 2024, 7:09 p.m. OK Python 3 TESTS 42 93 0 1800
259098157 lalitha_72 B May 2, 2024, 8:08 a.m. OK Python 3 TESTS 42 93 0 1800
258810174 2200033007_KLU B April 30, 2024, 4:09 a.m. OK Python 3 TESTS 40 93 0 1800
258507311 joelsolizchoque B April 28, 2024, 3:16 a.m. OK Python 3 TESTS 40 93 0 1800
259821605 cck111 B May 7, 2024, 3:43 a.m. OK Rust 2021 TESTS 42 46 0 1800
259615810 kiddoos B May 5, 2024, 10:04 a.m. OK Rust 2021 TESTS 42 77 102400 1800
258438812 toomer B April 27, 2024, 3:16 p.m. OK Rust 2021 TESTS 40 78 0 1800
258431201 sansen B April 27, 2024, 3 p.m. OK Rust 2021 TESTS 40 187 0 1800
258432050 qwerty787788 B April 27, 2024, 3:02 p.m. OK Rust 2021 TESTS 40 234 0 1800
258447627 MaxBuzz B April 27, 2024, 3:37 p.m. OK Scala TESTS 40 546 0 1800

remove filters

Back to search problems