Codeforces Round 924 (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
1928 Codeforces Round 924 (Div. 2) FINISHED False 7200 24179099 Feb. 11, 2024, 9:35 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 1740 ) E Modular Sequence PROGRAMMING constructive algorithms dp greedy implementation math number theory

B'You are given two integers x and y . A sequence a of length n is called modular if a_1=x , and for all 1 < i <= n the value of a_{i} is either a_{i-1} + y or a_{i-1} bmod y . Here x bmod y denotes the remainder from dividing x by y . Determine if there exists a modular sequence of length n with the sum of its elements equal to S , and if it exists, find any such sequence. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 2 cdot 10^4 ). The description of the test cases follows. The first and only line of each test case contains four integers n , x , y , and s ( 1 <= n <= 2 cdot 10^5 , 0 <= x <= 2 cdot 10^5 , 1 <= y <= 2 cdot 10^5 , 0 <= s <= 2 cdot 10^5 ) -- the length of the sequence, the parameters x and y , and the required sum of the sequence elements. The sum of n over all test cases does not exceed 2 cdot 10^5 , and also the sum of s over all test cases does not exceed 2 cdot 10^5 . For each test case, if the desired sequence exists, output "Yes" on the first line (without quotes). Then, on the second line, output n integers a_1, a_2, ldots, a_n separated by a space -- the elements of the sequence a . If there are multiple suitable sequences, output any of them. If the sequence does not exist, output "No" on a single line. You can output each letter in any case (lowercase or uppercase). For example, the strings "yEs", "yes", "Yes", and "YES" will be accepted as a positive answer. In the first example, the sequence [8, 11, 2, 5, 2] satisfies the conditions. Thus, a_1 = 8 = x , a_2 = 11 = a_1 + 3 , a_3 = 2 = a_2 bmod 3 , a_4 = 5 = a_3 + 3 , a_5 = 2 = a_4 bmod 3 . In the second example, the first element of the sequence should be equal to 5 , so the sequence [2'...

Tutorials

Codeforces Round 924 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
245851105 KumaTachiRen E Feb. 11, 2024, 11:53 a.m. OK C# 8 TESTS 76 187 6656000
245921773 rainboy E Feb. 11, 2024, 10:04 p.m. OK GNU C11 TESTS 81 1060 1843200
245851231 Youssef_Badr E Feb. 11, 2024, 11:53 a.m. OK GNU C++17 TESTS 76 31 13619200
245848652 kgandhi22 E Feb. 11, 2024, 11:32 a.m. OK GNU C++17 TESTS 76 62 11776000
245864131 pkhaustov E Feb. 11, 2024, 1:30 p.m. OK GNU C++17 TESTS 80 108 3174400
245877870 Hisiri E Feb. 11, 2024, 3:07 p.m. OK GNU C++17 TESTS 81 124 2457600
245910337 Jarif_Rahman E Feb. 11, 2024, 7:25 p.m. OK GNU C++17 TESTS 81 124 2457600
245862567 pkhaustov E Feb. 11, 2024, 1:18 p.m. OK GNU C++17 TESTS 80 124 3174400
245852826 Madsome E Feb. 11, 2024, 12:02 p.m. OK GNU C++17 TESTS 77 124 3174400
245864217 pkhaustov E Feb. 11, 2024, 1:31 p.m. OK GNU C++17 TESTS 80 124 3174400
245866616 celin E Feb. 11, 2024, 1:46 p.m. OK GNU C++17 TESTS 80 139 1638400
245863513 TrendBattles E Feb. 11, 2024, 1:26 p.m. OK GNU C++17 TESTS 80 139 3993600
245854004 Pablo-No E Feb. 11, 2024, 12:10 p.m. OK GNU C++17 (64) TESTS 78 46 3276800
245855479 Pablo-No E Feb. 11, 2024, 12:20 p.m. OK GNU C++17 (64) TESTS 80 46 3276800
245930379 hvyotivy E Feb. 12, 2024, 1:58 a.m. OK GNU C++17 (64) TESTS 82 46 17612800
245876060 -XXP- E Feb. 11, 2024, 2:55 p.m. OK GNU C++17 (64) TESTS 81 62 1638400
245875342 -XXP- E Feb. 11, 2024, 2:51 p.m. OK GNU C++17 (64) TESTS 81 62 3276800
245929810 sprads E Feb. 12, 2024, 1:44 a.m. OK GNU C++17 (64) TESTS 82 77 4812800
245929779 sprads E Feb. 12, 2024, 1:43 a.m. OK GNU C++17 (64) TESTS 82 78 4812800
245863587 adam01 E Feb. 11, 2024, 1:26 p.m. OK GNU C++17 (64) TESTS 80 93 4812800
245932494 hyxawa E Feb. 12, 2024, 2:55 a.m. OK GNU C++17 (64) TESTS 82 93 6451200
245854703 chappy1 E Feb. 11, 2024, 12:15 p.m. OK GNU C++17 (64) TESTS 78 93 8294400
245857476 threethreetwothree E Feb. 11, 2024, 12:36 p.m. OK GNU C++20 (64) TESTS 80 15 16384000
245922074 birsnot E Feb. 11, 2024, 10:10 p.m. OK GNU C++20 (64) TESTS 81 31 819200
245922122 birsnot E Feb. 11, 2024, 10:11 p.m. OK GNU C++20 (64) TESTS 81 31 819200
245857289 threethreetwothree E Feb. 11, 2024, 12:35 p.m. OK GNU C++20 (64) TESTS 80 31 16486400
245853842 enzopsm E Feb. 11, 2024, 12:09 p.m. OK GNU C++20 (64) TESTS 78 46 9523200
245856987 threethreetwothree E Feb. 11, 2024, 12:33 p.m. OK GNU C++20 (64) TESTS 80 46 16486400
245878761 RDDCCD E Feb. 11, 2024, 3:12 p.m. OK GNU C++20 (64) TESTS 81 61 2969600
245940107 jiangly E Feb. 12, 2024, 5:16 a.m. OK GNU C++20 (64) TESTS 82 62 2969600
245934742 Error_Yuan E Feb. 12, 2024, 3:40 a.m. OK GNU C++20 (64) TESTS 82 93 1638400
245934522 Error_Yuan E Feb. 12, 2024, 3:36 a.m. OK GNU C++20 (64) TESTS 82 93 1638400
245870595 profchi E Feb. 11, 2024, 2:15 p.m. OK Java 21 TESTS 81 639 3993600
245941414 man-ray E Feb. 12, 2024, 5:36 a.m. OK Java 21 TESTS 82 670 614400
245941548 man-ray E Feb. 12, 2024, 5:38 a.m. OK Java 21 TESTS 82 670 819200
245851278 cc4414 E Feb. 11, 2024, 11:53 a.m. OK Java 8 TESTS 76 326 0
245876778 tauros E Feb. 11, 2024, 3 p.m. OK Kotlin 1.9 TESTS 81 670 3891200
245917877 Ali_P E Feb. 11, 2024, 8:58 p.m. OK PyPy 3 TESTS 81 733 14028800
245926933 huikang E Feb. 12, 2024, 12:14 a.m. OK PyPy 3-64 TESTS 82 295 10956800
245873083 strashila E Feb. 11, 2024, 2:35 p.m. OK PyPy 3-64 TESTS 81 358 22425600
245851464 codicon E Feb. 11, 2024, 11:54 a.m. OK PyPy 3-64 TESTS 76 405 22732800
245884885 Alex239 E Feb. 11, 2024, 3:55 p.m. OK PyPy 3-64 TESTS 81 467 19660800
245849363 dirac_de E Feb. 11, 2024, 11:34 a.m. OK PyPy 3-64 TESTS 76 482 16384000
245907053 aPNJ777 E Feb. 11, 2024, 6:51 p.m. OK PyPy 3-64 TESTS 81 514 15155200
245912658 horrlod E Feb. 11, 2024, 7:51 p.m. OK PyPy 3-64 TESTS 81 670 27852800
245877879 Little_Sheep_Yawn E Feb. 11, 2024, 3:07 p.m. OK PyPy 3-64 TESTS 81 795 25088000
245937479 hunglomdom E Feb. 12, 2024, 4:33 a.m. OK PyPy 3-64 TESTS 82 826 47616000
245848957 googlweknoall E Feb. 11, 2024, 11:33 a.m. OK PyPy 3-64 TESTS 76 873 19968000

remove filters

Back to search problems