Codeforces Round 1043 (Div. 3)

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
2132 Codeforces Round 1043 (Div. 3) FINISHED False 8100 20618723 Aug. 21, 2025, 2:35 p.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 27592 ) C1 The Cunning Seller (easy version) PROGRAMMING greedy math

This is the easy version of the problem. The easy version differs from the hard one in that it requires determining the minimum cost with the least number of deals, while the hard version requires determining the minimum cost with a limited number of deals. After the cunning seller sold three watermelons instead of one, he decided to increase his profit — namely, he bought even more watermelons. Now he can sell (3^x) watermelons for (3^{x+1} + x \cdot 3^{x-1}) coins, where (x) is a non-negative integer. Such a sale is called a deal. A calculating buyer came to him, but he has critically little time. Because of this, he wants to buy exactly (n) watermelons, making the least possible number of deals. The buyer is in a hurry and has therefore turned to you to determine the minimum number of coins he must pay the seller for (n) watermelons, considering that he will make the least possible number of deals. The first line contains an integer (t) ((1 \le t \le 10^4)) — the number of test cases. The description of each test case follows. In a single line of each test case, there is one integer (n) ((1 \le n \le 10^9)) — how many watermelons need to be bought. For each test case, output a single integer — the minimum cost of the watermelons. Note that there is no point in buying more watermelons than needed, so we won't consider deals where there are more watermelons than necessary. Let's consider the costs of the first two deal options: Deal A: (1) watermelon — (3) coins. Deal B: (3) watermelons — (10) coins. In the first sample, the only way to buy (1) watermelon is to use Deal A, so the answer is (3). In the second sample, you can buy (3) watermelons with a single Deal B for (10) coins. In the third sample, you can make (2) Deals A and (2) Deals B, which will cost a total of (26) coins. If we make (3) deals, we can get (3), (5), (7), or (9) watermelons. If we make

Tutorials

Codeforces Round 1043 (Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
335116797 og.kostya C1 Aug. 23, 2025, 6:09 a.m. OK C# 13 TESTS 5 93 3174400
335097028 CP_killer C1 Aug. 23, 2025, 12:30 a.m. OK C++17 (GCC 7-32) TESTS 5 31 0
335249618 niko1473 C1 Aug. 24, 2025, 4:48 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335249594 Phoenix610 C1 Aug. 24, 2025, 4:48 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335234236 Mahim_69 C1 Aug. 24, 2025, 2:57 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335233337 WutongDeath C1 Aug. 24, 2025, 2:31 a.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335226633 adiverse2920 C1 Aug. 23, 2025, 10:29 p.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335220042 haytam_kenway C1 Aug. 23, 2025, 8:19 p.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335218434 madhavG C1 Aug. 23, 2025, 7:57 p.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335215547 shreyankp06 C1 Aug. 23, 2025, 7:21 p.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335214871 ihapiw C1 Aug. 23, 2025, 7:14 p.m. OK C++17 (GCC 7-32) TESTS 5 46 0
335129298 tsunk C1 Aug. 23, 2025, 8 a.m. OK C++20 (GCC 13-64) TESTS 5 31 0
335258106 thesatyamxyz C1 Aug. 24, 2025, 6:01 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335234071 anywayimverycute C1 Aug. 24, 2025, 2:53 a.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335224170 zanj0 C1 Aug. 23, 2025, 9:28 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335215737 HishamAlshehri1 C1 Aug. 23, 2025, 7:23 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335214138 Manvendra27 C1 Aug. 23, 2025, 7:06 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335213547 MayarSayed3 C1 Aug. 23, 2025, 7 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335212085 Believer_112 C1 Aug. 23, 2025, 6:46 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335211452 GalvaaaTroN C1 Aug. 23, 2025, 6:40 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335200169 Pranav-Bhat C1 Aug. 23, 2025, 5:12 p.m. OK C++20 (GCC 13-64) TESTS 5 46 0
335143372 Akiramenai_ C1 Aug. 23, 2025, 9:44 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
335099822 Jomify C1 Aug. 23, 2025, 1:48 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
335093707 sakuun C1 Aug. 22, 2025, 10:41 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
335066331 Jahid_hasan_Mahmud C1 Aug. 22, 2025, 4:52 p.m. OK C++23 (GCC 14-64, msys2) TESTS 5 31 0
335256555 fakhha C1 Aug. 24, 2025, 5:50 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
335251494 Kuroneko_njust C1 Aug. 24, 2025, 5:14 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
335244972 QuiqueLuna C1 Aug. 24, 2025, 4:32 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
335242065 Ahad C1 Aug. 24, 2025, 4:20 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
335236981 Dheeraj2010 C1 Aug. 24, 2025, 3:54 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
335236046 ssldft C1 Aug. 24, 2025, 3:38 a.m. OK C++23 (GCC 14-64, msys2) TESTS 5 46 0
335074587 AntonKorch C1 Aug. 22, 2025, 6:03 p.m. OK F# 9 TESTS 5 187 2457600
335187830 Ekluvya7 C1 Aug. 23, 2025, 3:29 p.m. OK GNU C11 TESTS 5 92 0
335182708 lakshmijayasri C1 Aug. 23, 2025, 2:46 p.m. OK GNU C11 TESTS 5 92 0
335219665 ICPCCode C1 Aug. 23, 2025, 8:13 p.m. OK GNU C11 TESTS 5 92 102400
335138904 lakshmijayasri C1 Aug. 23, 2025, 9:11 a.m. OK GNU C11 TESTS 5 92 102400
335027259 Abu_Jobail56224 C1 Aug. 22, 2025, 11:49 a.m. OK GNU C11 TESTS 5 93 0
335138630 lakshmijayasri C1 Aug. 23, 2025, 9:09 a.m. OK GNU C11 TESTS 5 108 0
335060913 KL2400031478 C1 Aug. 22, 2025, 4:08 p.m. OK GNU C11 TESTS 5 124 102400
335024459 shisukenohara C1 Aug. 22, 2025, 11:23 a.m. OK Go TESTS 5 77 204800
335075977 tekka_ity C1 Aug. 22, 2025, 6:15 p.m. OK Java 21 TESTS 5 233 0
335051100 Shoyo_kageyama C1 Aug. 22, 2025, 2:52 p.m. OK Java 21 TESTS 5 233 0
335042080 inseder C1 Aug. 22, 2025, 1:46 p.m. OK Java 21 TESTS 5 233 614400
335101390 Ayushman01 C1 Aug. 23, 2025, 2:25 a.m. OK Java 21 TESTS 5 234 614400
335167343 Raj_Borad_1729 C1 Aug. 23, 2025, 12:49 p.m. OK Java 21 TESTS 5 265 102400
335136223 Naveen18 C1 Aug. 23, 2025, 8:51 a.m. OK Java 21 TESTS 5 265 716800
335033202 Dinesh_k40 C1 Aug. 22, 2025, 12:39 p.m. OK Java 21 TESTS 5 280 614400
335213262 edum C1 Aug. 23, 2025, 6:57 p.m. OK Java 21 TESTS 5 280 819200
335140167 LordKRiS C1 Aug. 23, 2025, 9:20 a.m. OK Java 21 TESTS 5 280 1638400
335065692 abhinavk.ug23.cs C1 Aug. 22, 2025, 4:46 p.m. OK Java 21 TESTS 5 281 409600
335024453 TheDaemonThread C1 Aug. 22, 2025, 11:23 a.m. OK Java 8 TESTS 5 155 39014400
335051861 ashuramajestic C1 Aug. 22, 2025, 2:57 p.m. OK Java 8 TESTS 5 171 0
335088037 yashbansal99 C1 Aug. 22, 2025, 8:40 p.m. OK Java 8 TESTS 5 217 0
335160939 yashathwani C1 Aug. 23, 2025, 11:59 a.m. OK Java 8 TESTS 5 218 0
335148399 nareshveerapuram07 C1 Aug. 23, 2025, 10:21 a.m. OK Java 8 TESTS 5 218 0
335078930 raaz70583 C1 Aug. 22, 2025, 6:44 p.m. OK Java 8 TESTS 5 218 0
335187954 yuvrajshekhar00 C1 Aug. 23, 2025, 3:30 p.m. OK Java 8 TESTS 5 233 0
335174321 HeyMantastic C1 Aug. 23, 2025, 1:41 p.m. OK Java 8 TESTS 5 233 0
335119788 Mr5_X C1 Aug. 23, 2025, 6:38 a.m. OK Java 8 TESTS 5 233 0
335125468 manitejapattem C1 Aug. 23, 2025, 7:28 a.m. OK Java 8 TESTS 5 234 0
335185156 devkowsir C1 Aug. 23, 2025, 3:06 p.m. OK Node.js TESTS 5 202 6860800
335065630 karimmalidev C1 Aug. 22, 2025, 4:46 p.m. OK Node.js TESTS 5 281 9830400
335022168 Mr.Beast192 C1 Aug. 22, 2025, 11:01 a.m. OK PyPy 3 TESTS 5 186 4915200
335106731 adriandabeast C1 Aug. 23, 2025, 4:03 a.m. OK PyPy 3 TESTS 5 218 4915200
335160194 ravi_krst C1 Aug. 23, 2025, 11:53 a.m. OK PyPy 3 TESTS 5 233 4915200
335114955 Prathmesh_H C1 Aug. 23, 2025, 5:50 a.m. OK PyPy 3 TESTS 5 234 8908800
335076008 pratikmhaisane09 C1 Aug. 22, 2025, 6:15 p.m. OK PyPy 3 TESTS 5 264 7987200
335158283 prselvak C1 Aug. 23, 2025, 11:37 a.m. OK PyPy 3 TESTS 5 327 9523200
335171088 sathvik_666 C1 Aug. 23, 2025, 1:17 p.m. OK PyPy 3 TESTS 5 327 10137600
335221129 andreikonan C1 Aug. 23, 2025, 8:34 p.m. OK PyPy 3-64 TESTS 5 93 2355200
335185517 MinValgen C1 Aug. 23, 2025, 3:09 p.m. OK PyPy 3-64 TESTS 5 93 3072000
335018838 Om_Singh_ C1 Aug. 22, 2025, 10:27 a.m. OK PyPy 3-64 TESTS 5 108 2969600
335089252 NatiYoni C1 Aug. 22, 2025, 9 p.m. OK PyPy 3-64 TESTS 5 108 4505600
335194887 jay_kalaria C1 Aug. 23, 2025, 4:30 p.m. OK PyPy 3-64 TESTS 5 109 3072000
335166816 Mandeep_codes C1 Aug. 23, 2025, 12:45 p.m. OK PyPy 3-64 TESTS 5 109 3993600
335203173 reijnnn C1 Aug. 23, 2025, 5:35 p.m. OK PyPy 3-64 TESTS 5 109 4505600
335108916 paneerrrrrr C1 Aug. 23, 2025, 4:35 a.m. OK PyPy 3-64 TESTS 5 124 2150400
335026423 manoharsingh2402 C1 Aug. 22, 2025, 11:42 a.m. OK PyPy 3-64 TESTS 5 124 2150400
335048189 ramya_2129 C1 Aug. 22, 2025, 2:30 p.m. OK PyPy 3-64 TESTS 5 124 3174400
335091493 pratyushkumar2228 C1 Aug. 22, 2025, 9:44 p.m. OK Python 3 TESTS 5 93 204800
335223583 basicstuff2308 C1 Aug. 23, 2025, 9:16 p.m. OK Python 3 TESTS 5 93 1740800
335222779 basicstuff2308 C1 Aug. 23, 2025, 9:02 p.m. OK Python 3 TESTS 5 93 1740800
335222747 oussamafarhani C1 Aug. 23, 2025, 9:01 p.m. OK Python 3 TESTS 5 124 0
335088845 Srijato01 C1 Aug. 22, 2025, 8:53 p.m. OK Python 3 TESTS 5 124 0
335199694 JayeshGadilohar C1 Aug. 23, 2025, 5:09 p.m. OK Python 3 TESTS 5 124 1433600
335038773 harishkeerthimaans C1 Aug. 22, 2025, 1:23 p.m. OK Python 3 TESTS 5 140 0
335076062 Velvet_thunder1 C1 Aug. 22, 2025, 6:16 p.m. OK Python 3 TESTS 5 140 307200
335029833 QuadD4rv1n7 C1 Aug. 22, 2025, 12:11 p.m. OK Python 3 TESTS 5 140 409600
335054560 DivyMe C1 Aug. 22, 2025, 3:19 p.m. OK Python 3 TESTS 5 140 1433600
335194424 Ckiddo C1 Aug. 23, 2025, 4:26 p.m. OK Rust 2021 TESTS 5 62 0

remove filters

Back to search problems