CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!)

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
1870 CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) FINISHED False 8100 36775499 Sept. 18, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 7067 ) D Prefix Purchase PROGRAMMING binary search data structures greedy

B'You have an array a of size n , initially filled with zeros ( a_1 = a_2 = ldots = a_n = 0 ). You also have an array of integers c of size n . Initially, you have k coins. By paying c_i coins, you can add 1 to all elements of the array a from the first to the i -th element ( a_j mathrel{+}= 1 for all 1 <= q j <= q i ). You can buy any c_i any number of times. A purchase is only possible if k geq c_i , meaning that at any moment k geq 0 must hold true. Find the lexicographically largest array a that can be obtained. An array a is lexicographically smaller than an array b of the same length if and only if in the first position where a and b differ, the element in array a is smaller than the corresponding element in b . The first line contains a single integer t ( 1 <= q t <= q 10^4 ) -- the number of test cases. This is followed by a description of the test cases. The first line of each test case contains a single integer n ( 1 <= q n <= q 2 cdot 10^5 ) -- the size of arrays a and c . The second line of each test case contains n integers c_1, c_2, ldots, c_n ( 1 <= q c_i <= q 10^9 ) -- the array c . The third line of each test case contains a single integer k ( 1 <= q k <= q 10^9 ) -- the number of coins you have. It is guaranteed that the sum of all n values across all test cases does not exceed 2 cdot 10^5 . For each test case, output n integers a_1, a_2, ldots, a_n -- the lexicographically largest array a that can be obtained. In the first test case, a_1 cannot be greater than 5 , and if we buy c_1 five times, we will run out of money, so a = [5, 0, 0] . In the second test case, a_1 cannot be greater than 2 , but we can buy c_1 and c_2 once each (buying c_2 twice is not possible), so'...

Tutorials

CodeTON Round 6 (Div. 1 + Div. 2, Rated, Prizes!) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
223938351 tahtarovserver D Sept. 18, 2023, 7:44 p.m. OK C# 10 TESTS 26 155 38195200
223936603 rainboy D Sept. 18, 2023, 7:23 p.m. OK GNU C11 TESTS 26 873 819200
223918355 ghj1222 D Sept. 18, 2023, 4:48 p.m. OK GNU C11 TESTS 26 951 15360000
223916076 rkkashyap390 D Sept. 18, 2023, 4:44 p.m. OK GNU C++14 TESTS 26 78 1638400
223962465 OvO_Zuo D Sept. 19, 2023, 12:40 a.m. OK GNU C++14 TESTS 27 78 1638400
223927192 dimitri1244 D Sept. 18, 2023, 6:01 p.m. OK GNU C++14 TESTS 26 78 2355200
223964990 iamcclocation D Sept. 19, 2023, 1:35 a.m. OK GNU C++14 TESTS 27 78 6553600
223971801 prairie2022 D Sept. 19, 2023, 3:19 a.m. OK GNU C++14 TESTS 27 93 1433600
223924791 __HITman__ D Sept. 18, 2023, 5:44 p.m. OK GNU C++14 TESTS 26 93 1638400
223915041 CuteJerry D Sept. 18, 2023, 4:41 p.m. OK GNU C++14 TESTS 26 93 1638400
223916227 CHY2k6BuiDinhQuyen D Sept. 18, 2023, 4:44 p.m. OK GNU C++14 TESTS 26 93 1638400
223922367 lwsq D Sept. 18, 2023, 5:31 p.m. OK GNU C++14 TESTS 26 93 1638400
223976855 wxyz190502 D Sept. 19, 2023, 4:42 a.m. OK GNU C++14 TESTS 27 93 2252800
223964746 Charming D Sept. 19, 2023, 1:30 a.m. OK GNU C++17 TESTS 27 62 5427200
223913835 ultizet D Sept. 18, 2023, 4:38 p.m. OK GNU C++17 TESTS 26 77 2150400
223955914 Mohammadalhelue D Sept. 18, 2023, 9:43 p.m. OK GNU C++17 TESTS 26 78 819200
223913052 yoyoboyss D Sept. 18, 2023, 4:36 p.m. OK GNU C++17 TESTS 26 78 1228800
223967477 52xwj D Sept. 19, 2023, 2:24 a.m. OK GNU C++17 TESTS 27 78 1638400
223935501 Mhamad_aboaljood D Sept. 18, 2023, 7:11 p.m. OK GNU C++17 TESTS 26 78 1638400
223933106 Robshak D Sept. 18, 2023, 6:48 p.m. OK GNU C++17 TESTS 26 78 1638400
223930745 divyansh29r D Sept. 18, 2023, 6:26 p.m. OK GNU C++17 TESTS 26 78 1638400
223980588 xiheyaoling D Sept. 19, 2023, 5:39 a.m. OK GNU C++17 TESTS 27 78 1638400
223979742 ST_ring D Sept. 19, 2023, 5:27 a.m. OK GNU C++17 TESTS 27 78 1638400
223927132 XH_v D Sept. 18, 2023, 6:01 p.m. OK GNU C++17 (64) TESTS 26 62 819200
223958216 MaGnsi0 D Sept. 18, 2023, 10:37 p.m. OK GNU C++17 (64) TESTS 26 62 819200
223972327 lunchbox D Sept. 19, 2023, 3:27 a.m. OK GNU C++17 (64) TESTS 27 62 819200
223973211 1111456 D Sept. 19, 2023, 3:42 a.m. OK GNU C++17 (64) TESTS 27 62 1638400
223960074 camc D Sept. 18, 2023, 11:35 p.m. OK GNU C++17 (64) TESTS 26 62 1638400
223951641 Pepper_yzy D Sept. 18, 2023, 8:29 p.m. OK GNU C++17 (64) TESTS 26 62 1638400
223910621 anhkha1004 D Sept. 18, 2023, 4:30 p.m. OK GNU C++17 (64) TESTS 26 62 1638400
223974332 RohitRKS D Sept. 19, 2023, 4 a.m. OK GNU C++17 (64) TESTS 27 62 1638400
223973966 Owmicron D Sept. 19, 2023, 3:55 a.m. OK GNU C++17 (64) TESTS 27 62 1638400
223976832 wangjunchao D Sept. 19, 2023, 4:42 a.m. OK GNU C++17 (64) TESTS 27 62 2457600
223912141 nekoyukino D Sept. 18, 2023, 4:34 p.m. OK GNU C++20 (64) TESTS 26 31 7475200
223962048 OutsiderZz D Sept. 19, 2023, 12:29 a.m. OK GNU C++20 (64) TESTS 27 46 819200
223981813 stop D Sept. 19, 2023, 5:56 a.m. OK GNU C++20 (64) TESTS 27 46 819200
223980899 prz1213 D Sept. 19, 2023, 5:43 a.m. OK GNU C++20 (64) TESTS 27 46 819200
223975426 Ligh0x74 D Sept. 19, 2023, 4:19 a.m. OK GNU C++20 (64) TESTS 27 46 819200
223963356 anfei D Sept. 19, 2023, 1:01 a.m. OK GNU C++20 (64) TESTS 27 46 819200
223959813 Tansho D Sept. 18, 2023, 11:26 p.m. OK GNU C++20 (64) TESTS 26 46 819200
223928061 don2001 D Sept. 18, 2023, 6:08 p.m. OK GNU C++20 (64) TESTS 26 46 819200
223927934 BortiK D Sept. 18, 2023, 6:07 p.m. OK GNU C++20 (64) TESTS 26 46 819200
223927759 mohmed2003 D Sept. 18, 2023, 6:05 p.m. OK GNU C++20 (64) TESTS 26 46 819200
223932016 GR1ZLER D Sept. 18, 2023, 6:37 p.m. OK Java 11 TESTS 26 233 0
223926292 FierteDeCeylan D Sept. 18, 2023, 5:54 p.m. OK Java 11 TESTS 26 264 2867200
223928832 GR1ZLER D Sept. 18, 2023, 6:14 p.m. OK Java 11 TESTS 26 358 0
223913865 kratos56 D Sept. 18, 2023, 4:38 p.m. OK Java 11 TESTS 26 358 0
223911059 KlayThompson11 D Sept. 18, 2023, 4:32 p.m. OK Java 11 TESTS 26 405 0
223968652 WORTH D Sept. 19, 2023, 2:45 a.m. OK Java 11 TESTS 27 451 18739200
223980427 kasiru_69 D Sept. 19, 2023, 5:37 a.m. OK Java 11 TESTS 27 904 1536000
223928621 dzhi D Sept. 18, 2023, 6:12 p.m. OK Java 17 TESTS 26 311 1433600
223928342 dzhi D Sept. 18, 2023, 6:10 p.m. OK Java 17 TESTS 26 342 5222400
223927996 dzhi D Sept. 18, 2023, 6:07 p.m. OK Java 17 TESTS 26 373 6144000
223934471 NerfThis D Sept. 18, 2023, 7:01 p.m. OK Java 8 TESTS 26 171 2969600
223981113 xfrog D Sept. 19, 2023, 5:46 a.m. OK MS C++ 2017 TESTS 27 358 819200
223938203 ahtoh_ D Sept. 18, 2023, 7:42 p.m. OK Node.js TESTS 26 171 34508800
223911231 Gaurav1 D Sept. 18, 2023, 4:32 p.m. OK PyPy 2 TESTS 26 327 25804800
223974398 YMSeah D Sept. 19, 2023, 4:01 a.m. OK PyPy 3 TESTS 27 233 24678400
223915531 Wind5654 D Sept. 18, 2023, 4:42 p.m. OK PyPy 3 TESTS 26 732 25497600
223973716 Vaishnavi_054 D Sept. 19, 2023, 3:51 a.m. OK PyPy 3-64 TESTS 27 140 30003200
223933455 SoleProprietor D Sept. 18, 2023, 6:51 p.m. OK PyPy 3-64 TESTS 26 155 29184000
223957413 denilb D Sept. 18, 2023, 10:17 p.m. OK PyPy 3-64 TESTS 26 171 27852800
223932980 enova D Sept. 18, 2023, 6:47 p.m. OK PyPy 3-64 TESTS 26 171 30003200
223973438 grente D Sept. 19, 2023, 3:46 a.m. OK PyPy 3-64 TESTS 27 202 20582400
223915488 khanter_ D Sept. 18, 2023, 4:42 p.m. OK PyPy 3-64 TESTS 26 202 27955200
223928929 Divyanshu_81 D Sept. 18, 2023, 6:15 p.m. OK PyPy 3-64 TESTS 26 202 28672000
223934339 codingfennel D Sept. 18, 2023, 7 p.m. OK PyPy 3-64 TESTS 26 217 30105600
223957235 Jayg000e D Sept. 18, 2023, 10:12 p.m. OK PyPy 3-64 TESTS 26 217 31334400
223923977 the_pyhulk D Sept. 18, 2023, 5:39 p.m. OK PyPy 3-64 TESTS 26 218 38297600
223911247 weawemam D Sept. 18, 2023, 4:32 p.m. OK Python 3 TESTS 26 499 34099200
223975001 hunglomdom D Sept. 19, 2023, 4:11 a.m. OK Python 3 TESTS 27 530 27340800
223967171 nitin2203 D Sept. 19, 2023, 2:19 a.m. OK Python 3 TESTS 27 623 29286400

remove filters

Back to search problems