Codeforces Round 816 (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
1715 Codeforces Round 816 (Div. 2) FINISHED False 8100 70817099 Aug. 20, 2022, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 22291 ) B Beautiful Array PROGRAMMING constructive algorithms greedy math

B'Stanley defines the beauty of an array a of length n , which contains non-negative integers, as follows: sum limits_{i = 1}^{n} <= ft lfloor frac{a_{i}}{k} right rfloor, which means that we divide each element by k , round it down, and sum up the resulting values. Stanley told Sam the integer k and asked him to find an array a of n non-negative integers, such that the beauty is equal to b and the sum of elements is equal to s . Help Sam -- find any of the arrays satisfying the conditions above. Each test contains multiple test cases. The first line contains the number of test cases t ( 1 <= t <= 1000 ). Description of the test cases follows. The first line of each test case contains integers n , k , b , s ( 1 <= q n <= q 10^{5} , 1 <= q k <= q 10^{9} , 0 <= q b <= q 10^{9} , 0 <= q s <= q 10^{18} ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case print -1 if such array a does not exist. Otherwise print n non-negative integers a_1, a_2, ldots, a_n ( 0 <= q a_{i} <= q 10^{18} ) -- the answer. In the first, the second, the fifth and the sixth test cases of the example it is possible to show that such array does not exist. In the third testcase of the example a = [0, 0, 19] . The sum of elements in it is equal to 19, the beauty of it is equal to <= ft ( <= ft lfloor frac{0}{6} right rfloor + <= ft lfloor frac{0}{6} right rfloor + <= ft lfloor frac{19}{6} right rfloor right ) = (0 + 0 + 3) = 3 . In the fourth testcase of the example a = [0, 3, 3, 3, 29] . The sum of elements in it is equal to 38 , the beauty of it is equal to (0 + 0 + 0 + 0 + 7) = 7 . '...

Tutorials

Codeforces Round #816 (Div. 2) editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
169204379 6-_-9 B Aug. 21, 2022, 6:29 a.m. OK C# 10 TESTS 15 77 13209600
169232808 Galya2 B Aug. 21, 2022, 11:54 a.m. OK C# 10 TESTS 15 312 5632000
169376685 FatalityNT B Aug. 22, 2022, 9:35 p.m. OK C# 8 TESTS 15 156 3993600
169299558 SixFingure B Aug. 22, 2022, 6:01 a.m. OK Clang++17 Diagnostics TESTS 15 374 1024000
169299709 arpitmathur B Aug. 22, 2022, 6:04 a.m. OK Clang++17 Diagnostics TESTS 15 374 1024000
169328312 191530002 B Aug. 22, 2022, 11:45 a.m. OK Clang++17 Diagnostics TESTS 15 389 1024000
169300026 arpitmathur B Aug. 22, 2022, 6:09 a.m. OK Clang++17 Diagnostics TESTS 15 390 1024000
169369108 HuaTsai B Aug. 22, 2022, 7:10 p.m. OK Clang++20 Diagnostics TESTS 15 327 0
169270548 diralik B Aug. 21, 2022, 6:45 p.m. OK Clang++20 Diagnostics TESTS 15 342 1024000
169307416 sachin_sharma_006 B Aug. 22, 2022, 7:51 a.m. OK Clang++20 Diagnostics TESTS 15 374 1024000
169187570 quochuong2006 B Aug. 21, 2022, 1:06 a.m. OK FPC TESTS 15 280 0
169248190 oqfiqh B Aug. 21, 2022, 2:39 p.m. OK GNU C11 TESTS 15 405 0
169246471 keerthanareddy123 B Aug. 21, 2022, 2:20 p.m. OK GNU C11 TESTS 15 421 0
169262208 gcet_2024 B Aug. 21, 2022, 5:11 p.m. OK GNU C11 TESTS 15 421 0
169302124 GZZHX B Aug. 22, 2022, 6:41 a.m. OK GNU C++14 TESTS 15 15 0
169286856 bucket_xv B Aug. 22, 2022, 1:24 a.m. OK GNU C++14 TESTS 15 15 0
169283928 0x0000 B Aug. 21, 2022, 11:43 p.m. OK GNU C++14 TESTS 15 15 0
169190762 myee B Aug. 21, 2022, 2:22 a.m. OK GNU C++14 TESTS 15 15 0
169386631 Binary_1110011_ B Aug. 23, 2022, 3:59 a.m. OK GNU C++14 TESTS 15 15 0
169387041 njq B Aug. 23, 2022, 4:21 a.m. OK GNU C++14 TESTS 15 15 0
169337996 pallavi-1812 B Aug. 22, 2022, 1:28 p.m. OK GNU C++14 TESTS 15 15 0
169320946 zxr00000 B Aug. 22, 2022, 10:21 a.m. OK GNU C++14 TESTS 15 15 819200
169225970 azibGondal B Aug. 21, 2022, 10:42 a.m. OK GNU C++14 TESTS 15 15 819200
169222801 stopping_by_woods B Aug. 21, 2022, 10:08 a.m. OK GNU C++14 TESTS 15 15 819200
169324994 vishwajeet7381 B Aug. 22, 2022, 11:07 a.m. OK GNU C++17 TESTS 15 15 0
169301051 B_iShu B Aug. 22, 2022, 6:24 a.m. OK GNU C++17 TESTS 15 15 0
169292773 sidnigam B Aug. 22, 2022, 3:41 a.m. OK GNU C++17 TESTS 15 15 0
169292160 Cycyes B Aug. 22, 2022, 3:27 a.m. OK GNU C++17 TESTS 15 15 0
169289305 Bricchon B Aug. 22, 2022, 2:23 a.m. OK GNU C++17 TESTS 15 15 0
169256687 Rifat_Rahman_Rafi B Aug. 21, 2022, 4:11 p.m. OK GNU C++17 TESTS 15 15 0
169251779 AbdurRahman_040 B Aug. 21, 2022, 3:17 p.m. OK GNU C++17 TESTS 15 15 0
169221174 WUTONGHUA02 B Aug. 21, 2022, 9:52 a.m. OK GNU C++17 TESTS 15 15 0
169206736 Colblue B Aug. 21, 2022, 6:59 a.m. OK GNU C++17 TESTS 15 15 0
169297349 Breakfast87 B Aug. 22, 2022, 5:24 a.m. OK GNU C++17 TESTS 15 15 819200
169223261 burak_ozzkan B Aug. 21, 2022, 10:13 a.m. OK GNU C++17 (64) TESTS 15 15 0
169186353 AntKing B Aug. 21, 2022, 12:27 a.m. OK GNU C++17 (64) TESTS 15 15 0
169211965 bhatta.subhro B Aug. 21, 2022, 8:08 a.m. OK GNU C++17 (64) TESTS 15 15 0
169186833 linxd B Aug. 21, 2022, 12:43 a.m. OK GNU C++17 (64) TESTS 15 15 0
169315040 Sakib62 B Aug. 22, 2022, 9:17 a.m. OK GNU C++17 (64) TESTS 15 15 0
169347949 Aleks5d B Aug. 22, 2022, 3:09 p.m. OK GNU C++17 (64) TESTS 15 15 0
169285224 PCC B Aug. 22, 2022, 12:33 a.m. OK GNU C++17 (64) TESTS 15 15 819200
169274215 PandemicP B Aug. 21, 2022, 7:38 p.m. OK GNU C++17 (64) TESTS 15 15 819200
169292096 jose_0222 B Aug. 22, 2022, 3:26 a.m. OK GNU C++17 (64) TESTS 15 15 819200
169335787 Boris_Yakunin B Aug. 22, 2022, 1:05 p.m. OK GNU C++17 (64) TESTS 15 15 819200
169311280 Aryan1729 B Aug. 22, 2022, 8:37 a.m. OK GNU C++20 (64) TESTS 15 15 0
169380361 joudy_alayoubi B Aug. 22, 2022, 11:33 p.m. OK GNU C++20 (64) TESTS 15 15 0
169337216 Abugozah B Aug. 22, 2022, 1:20 p.m. OK GNU C++20 (64) TESTS 15 15 0
169337095 dod_for_code B Aug. 22, 2022, 1:19 p.m. OK GNU C++20 (64) TESTS 15 15 0
169323962 PiRaJo4ek B Aug. 22, 2022, 10:57 a.m. OK GNU C++20 (64) TESTS 15 15 0
169301298 Primesz B Aug. 22, 2022, 6:28 a.m. OK GNU C++20 (64) TESTS 15 15 0
169293615 fdshl B Aug. 22, 2022, 4 a.m. OK GNU C++20 (64) TESTS 15 15 0
169292913 fdshl B Aug. 22, 2022, 3:44 a.m. OK GNU C++20 (64) TESTS 15 15 0
169291787 HugeWide B Aug. 22, 2022, 3:18 a.m. OK GNU C++20 (64) TESTS 15 15 0
169272976 riskr_21 B Aug. 21, 2022, 7:18 p.m. OK GNU C++20 (64) TESTS 15 15 0
169327497 obourgain B Aug. 22, 2022, 11:36 a.m. OK Java 11 TESTS 15 187 0
169297087 wantu B Aug. 22, 2022, 5:18 a.m. OK Java 11 TESTS 15 187 0
169207290 saksham19270 B Aug. 21, 2022, 7:06 a.m. OK Java 11 TESTS 15 187 0
169253269 dpsn743 B Aug. 21, 2022, 3:33 p.m. OK Java 11 TESTS 15 202 0
169367925 Shady_X B Aug. 22, 2022, 6:53 p.m. OK Java 11 TESTS 15 202 0
169333379 doomhammer. B Aug. 22, 2022, 12:39 p.m. OK Java 11 TESTS 15 202 0
169266793 yash13203 B Aug. 21, 2022, 6:02 p.m. OK Java 11 TESTS 15 202 0
169260270 KarMa_ B Aug. 21, 2022, 4:50 p.m. OK Java 11 TESTS 15 202 0
169253443 _mza B Aug. 21, 2022, 3:35 p.m. OK Java 11 TESTS 15 202 0
169252209 bubnov B Aug. 21, 2022, 3:21 p.m. OK Java 11 TESTS 15 202 0
169189289 Mamimi B Aug. 21, 2022, 1:50 a.m. OK Java 17 TESTS 15 202 512000
169280271 matzhao B Aug. 21, 2022, 9:41 p.m. OK Java 17 TESTS 15 249 409600
169189423 kkz666 B Aug. 21, 2022, 1:53 a.m. OK Java 17 TESTS 15 249 614400
169339213 ivanshubin B Aug. 22, 2022, 1:40 p.m. OK Java 17 TESTS 15 265 102400
169204344 jaddlex B Aug. 21, 2022, 6:29 a.m. OK Java 17 TESTS 15 280 409600
169293174 goalboy B Aug. 22, 2022, 3:50 a.m. OK Java 17 TESTS 15 280 5939200
169363209 _spiralJava_ B Aug. 22, 2022, 5:54 p.m. OK Java 17 TESTS 15 514 716800
169235672 Saurav25823 B Aug. 21, 2022, 12:26 p.m. OK Java 17 TESTS 15 530 204800
169347560 tony4875 B Aug. 22, 2022, 3:05 p.m. OK Java 17 TESTS 15 545 204800
169295435 Jingfan.K B Aug. 22, 2022, 4:44 a.m. OK Java 17 TESTS 15 560 512000
169348883 ZhassanB B Aug. 22, 2022, 3:19 p.m. OK Java 8 TESTS 15 109 0
169293734 Java_Programmer B Aug. 22, 2022, 4:04 a.m. OK Java 8 TESTS 15 109 0
169238844 jkslyk B Aug. 21, 2022, 1:01 p.m. OK Java 8 TESTS 15 109 0
169312952 Lelouch_12 B Aug. 22, 2022, 8:55 a.m. OK Java 8 TESTS 15 124 0
169301123 yashpandey73 B Aug. 22, 2022, 6:26 a.m. OK Java 8 TESTS 15 124 0
169212558 -crazy_coder- B Aug. 21, 2022, 8:15 a.m. OK Java 8 TESTS 15 124 0
169270497 rookie19 B Aug. 21, 2022, 6:44 p.m. OK Java 8 TESTS 15 124 10137600
169229586 Juhaied_nabid B Aug. 21, 2022, 11:20 a.m. OK Java 8 TESTS 15 140 0
169213627 ak_ankit B Aug. 21, 2022, 8:28 a.m. OK Java 8 TESTS 15 140 0
169284325 hkurokawa B Aug. 21, 2022, 11:59 p.m. OK Java 8 TESTS 15 156 0
169223768 MikeInferno B Aug. 21, 2022, 10:19 a.m. OK Kotlin 1.6 TESTS 15 545 0
169242665 xuhe86950 B Aug. 21, 2022, 1:41 p.m. OK MS C++ 2017 TESTS 15 31 0
169236464 Danbbler B Aug. 21, 2022, 12:35 p.m. OK MS C++ 2017 TESTS 15 62 0
169196900 kidneywastaken B Aug. 21, 2022, 4:31 a.m. OK MS C++ 2017 TESTS 15 62 819200
169205944 Nosov_Vovanus2022 B Aug. 21, 2022, 6:49 a.m. OK MS C++ 2017 TESTS 15 77 819200
169265639 vineet11 B Aug. 21, 2022, 5:49 p.m. OK MS C++ 2017 TESTS 15 77 921600
169235156 1_shivam B Aug. 21, 2022, 12:20 p.m. OK MS C++ 2017 TESTS 15 78 819200
169266309 MohammedSB B Aug. 21, 2022, 5:56 p.m. OK MS C++ 2017 TESTS 15 78 1638400
169205977 griffindor B Aug. 21, 2022, 6:50 a.m. OK PyPy 3 TESTS 15 139 5939200
169193489 Liberator187 B Aug. 21, 2022, 3:20 a.m. OK PyPy 3 TESTS 15 155 6451200
169352850 maciaas B Aug. 22, 2022, 4 p.m. OK PyPy 3 TESTS 15 156 7065600
169248239 LFcowering B Aug. 21, 2022, 2:40 p.m. OK PyPy 3 TESTS 15 170 9728000
169282768 hxu10 B Aug. 21, 2022, 10:58 p.m. OK PyPy 3 TESTS 15 171 9830400
169295550 C_M_D_O_ B Aug. 22, 2022, 4:47 a.m. OK PyPy 3 TESTS 15 171 12185600
169377355 grawlixes B Aug. 22, 2022, 9:54 p.m. OK PyPy 3 TESTS 15 186 11161600
169206637 rajeshpenugonda6 B Aug. 21, 2022, 6:58 a.m. OK PyPy 3 TESTS 15 186 12083200
169247841 LFcowering B Aug. 21, 2022, 2:35 p.m. OK PyPy 3 TESTS 15 187 10035200
169248174 LFcowering B Aug. 21, 2022, 2:39 p.m. OK PyPy 3 TESTS 15 218 9728000
169288621 InariInDream B Aug. 22, 2022, 2:07 a.m. OK PyPy 3-64 TESTS 15 93 7884800
169343964 voicon B Aug. 22, 2022, 2:27 p.m. OK PyPy 3-64 TESTS 15 93 8294400
169196441 Youarenotgood B Aug. 21, 2022, 4:22 a.m. OK PyPy 3-64 TESTS 15 93 9728000
169377950 nealzane B Aug. 22, 2022, 10:09 p.m. OK PyPy 3-64 TESTS 15 108 10649600
169193738 harshvora64 B Aug. 21, 2022, 3:25 a.m. OK PyPy 3-64 TESTS 15 124 3788800
169226728 VedantDeo B Aug. 21, 2022, 10:50 a.m. OK PyPy 3-64 TESTS 15 124 7577600
169263962 govindp47 B Aug. 21, 2022, 5:30 p.m. OK PyPy 3-64 TESTS 15 124 10342400
169188065 lyreloi B Aug. 21, 2022, 1:19 a.m. OK PyPy 3-64 TESTS 15 124 10342400
169380611 novellep B Aug. 22, 2022, 11:43 p.m. OK PyPy 3-64 TESTS 15 139 4915200
169201269 PVR11 B Aug. 21, 2022, 5:45 a.m. OK PyPy 3-64 TESTS 15 139 7270400
169234008 nagasaikayithi B Aug. 21, 2022, 12:08 p.m. OK Python 3 TESTS 15 93 4915200
169210577 Lucky0820 B Aug. 21, 2022, 7:50 a.m. OK Python 3 TESTS 15 108 4300800
169243877 Jvaeyhcd B Aug. 21, 2022, 1:54 p.m. OK Python 3 TESTS 15 155 1126400
169337222 WDITzjt B Aug. 22, 2022, 1:20 p.m. OK Python 3 TESTS 15 156 1126400
169327451 ChinaMIFan B Aug. 22, 2022, 11:36 a.m. OK Python 3 TESTS 15 156 4096000
169310959 akshit2343 B Aug. 22, 2022, 8:33 a.m. OK Python 3 TESTS 15 171 1433600
169232902 DivyanshPradhan14 B Aug. 21, 2022, 11:56 a.m. OK Python 3 TESTS 15 171 1433600
169222710 Ara_2001 B Aug. 21, 2022, 10:07 a.m. OK Python 3 TESTS 15 171 1433600
169209054 HexHowells B Aug. 21, 2022, 7:30 a.m. OK Python 3 TESTS 15 171 1843200
169203553 bissenbay B Aug. 21, 2022, 6:18 a.m. OK Python 3 TESTS 15 171 1945600
169301078 Svlad_Cjelli B Aug. 22, 2022, 6:25 a.m. OK Rust 2021 TESTS 15 15 819200
169225553 p-a-t B Aug. 21, 2022, 10:38 a.m. OK Rust 2021 TESTS 15 31 819200

remove filters

Back to search problems