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 |
---|---|---|---|---|---|---|
1951 | Codeforces Global Round 25 | FINISHED | False | 10800 | 24765863 | April 6, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 5577 ) | D | Buying Jewels | PROGRAMMING | constructive algorithms greedy math |
B'Alice has n coins and wants to shop at Bob 's jewelry store. Today, although Bob has not set up the store yet, Bob wants to make sure Alice will buy exactly k jewels. To set up the store, Bob can erect at most 60 stalls (each containing an unlimited amount of jewels) and set the price per jewel for each stall to be an integer number of coins between 1 and 10^{18} . Fortunately, Bob knows that Alice buys greedily: and she will go to stall 1 , buy as many jewels as possible, then go to stall 2 , buy as many jewels as possible, and so on until the last stall. Knowing this, Bob can choose the number of stalls to set up, as well as set the price for each stall so that Alice buys exactly k jewels. Help Bob fulfill the task, or determine if it is impossible to do so. Note that Alice does not need to spend all her coins. Each test contains multiple test cases. The first line contains an integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of the test cases follows. Each test case contains two positive integers n and k ( 1 <= n, k <= 10^{18} ) -- the number of coins Alice has and the number of jewels Bob wants Alice to have bought at the end. For each test case, print on one line "YES" if Bob can erect at most 60 stalls and set the prices for the stalls such that Alice buys exactly k jewels, or "NO" if it is impossible to do so. If the answer is "YES", on the second line, print an integer s ( 1 <= s <= 60 ) -- the number of stalls to be set up by Bob. On the third line, print s positive integers p_1, p_2, ldots, p_s ( 1 <= p_i <= 10^{18}) that represent such a satisfactory pricing p , where p_i is the price per jewel for stall i . If there are multiple such p 's, print any of them. In the first test case, at the first stall, Alice buys 3 jewels and is left with 1 coin. This is not enough to'... |
Codeforces Global Round 25 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
255412675 | karamkontar | D | April 7, 2024, 4:35 a.m. | OK | C# 10 | TESTS | 6 | 77 | 614400 | ||
255412244 | karamkontar | D | April 7, 2024, 4:29 a.m. | OK | C# 10 | TESTS | 6 | 77 | 614400 | ||
255414519 | karamkontar | D | April 7, 2024, 4:56 a.m. | OK | C# 10 | TESTS | 6 | 93 | 409600 | ||
255420297 | Adiat | D | April 7, 2024, 5:53 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255413197 | abhi_8923 | D | April 7, 2024, 4:41 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255410974 | TrendBattles | D | April 7, 2024, 4:13 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255410841 | dungprozzz | D | April 7, 2024, 4:11 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255408798 | t1r3d_ | D | April 7, 2024, 3:43 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255407131 | YGkingNan | D | April 7, 2024, 3:19 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255405796 | athc | D | April 7, 2024, 2:56 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255401938 | Ether13 | D | April 7, 2024, 1:52 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255400086 | qwqer233 | D | April 7, 2024, 1:19 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255399107 | Sin_Watt | D | April 7, 2024, 1:01 a.m. | OK | C++14 (GCC 6-32) | TESTS | 6 | 46 | 0 | ||
255412061 | Jin-Keeper | D | April 7, 2024, 4:27 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 0 | ||
255392888 | Muted_slow | D | April 6, 2024, 11:06 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 0 | ||
255355488 | virat1906 | D | April 6, 2024, 5:23 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 0 | ||
255410932 | kmsgk | D | April 7, 2024, 4:13 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 102400 | ||
255395865 | liguanghan1 | D | April 6, 2024, 11:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 102400 | ||
255368632 | _---galib---_ | D | April 6, 2024, 6:50 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 102400 | ||
255389429 | kunal168 | D | April 6, 2024, 10:12 p.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 31 | 2662400 | ||
255422547 | _anidravi | D | April 7, 2024, 6 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 46 | 0 | ||
255421999 | Hessenburg | D | April 7, 2024, 5:55 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 46 | 0 | ||
255419057 | shiv13 | D | April 7, 2024, 5:41 a.m. | OK | C++17 (GCC 7-32) | TESTS | 6 | 46 | 0 | ||
255401620 | kabu | D | April 7, 2024, 1:47 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 30 | 102400 | ||
255414570 | rulerofcakes | D | April 7, 2024, 4:57 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255411971 | bluerar | D | April 7, 2024, 4:26 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255406755 | Younger | D | April 7, 2024, 3:13 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255401910 | KK_1729 | D | April 7, 2024, 1:52 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255398543 | LLGM | D | April 7, 2024, 12:50 a.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255395783 | D_F_S | D | April 6, 2024, 11:58 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255379588 | Menezes_Dean | D | April 6, 2024, 8:23 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255367485 | pinog | D | April 6, 2024, 6:41 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255366335 | abner_vidal | D | April 6, 2024, 6:33 p.m. | OK | C++20 (GCC 13-64) | TESTS | 6 | 31 | 0 | ||
255407776 | klu_2200030883 | D | April 7, 2024, 3:29 a.m. | OK | GNU C11 | TESTS | 6 | 46 | 102400 | ||
255381769 | rainboy | D | April 6, 2024, 8:43 p.m. | OK | GNU C11 | TESTS | 6 | 46 | 102400 | ||
255416518 | Specter_TheUnchained | D | April 7, 2024, 5:17 a.m. | OK | Go | TESTS | 6 | 46 | 204800 | ||
255402546 | nguyenquocthao00 | D | April 7, 2024, 2:03 a.m. | OK | Go | TESTS | 6 | 46 | 204800 | ||
255416654 | nguyenquocthao00 | D | April 7, 2024, 5:19 a.m. | OK | Go | TESTS | 6 | 61 | 204800 | ||
255370861 | smsh.7 | D | April 6, 2024, 7:08 p.m. | OK | Haskell | TESTS | 6 | 77 | 0 | ||
255408988 | amit_roy | D | April 7, 2024, 3:45 a.m. | OK | Java 21 | TESTS | 6 | 202 | 307200 | ||
255373843 | polsage | D | April 6, 2024, 7:32 p.m. | OK | Java 21 | TESTS | 6 | 233 | 614400 | ||
255403182 | priyaroy3370 | D | April 7, 2024, 2:14 a.m. | OK | Java 21 | TESTS | 6 | 249 | 512000 | ||
255379910 | ash_79 | D | April 6, 2024, 8:26 p.m. | OK | Java 21 | TESTS | 6 | 249 | 921600 | ||
255403081 | RiceTofu | D | April 7, 2024, 2:12 a.m. | OK | Java 21 | TESTS | 6 | 265 | 819200 | ||
255387464 | mkah123 | D | April 6, 2024, 9:46 p.m. | OK | Java 21 | TESTS | 6 | 280 | 614400 | ||
255359305 | Quasicoherent | D | April 6, 2024, 5:33 p.m. | OK | Java 21 | TESTS | 6 | 281 | 716800 | ||
255358191 | Jhinnnnnn | D | April 6, 2024, 5:30 p.m. | OK | Java 21 | TESTS | 6 | 296 | 409600 | ||
255372148 | maneh | D | April 6, 2024, 7:18 p.m. | OK | Java 21 | TESTS | 6 | 296 | 1331200 | ||
255386845 | mkah123 | D | April 6, 2024, 9:39 p.m. | OK | Java 21 | TESTS | 6 | 327 | 921600 | ||
255386726 | fetetriste | D | April 6, 2024, 9:37 p.m. | OK | Java 8 | TESTS | 6 | 140 | 0 | ||
255385208 | wat2 | D | April 6, 2024, 9:19 p.m. | OK | Java 8 | TESTS | 6 | 140 | 0 | ||
255364010 | samy10127 | D | April 6, 2024, 6:21 p.m. | OK | Java 8 | TESTS | 6 | 140 | 0 | ||
255369763 | Yousef_Badr | D | April 6, 2024, 6:59 p.m. | OK | Java 8 | TESTS | 6 | 155 | 0 | ||
255402825 | duyipeng | D | April 7, 2024, 2:08 a.m. | OK | Java 8 | TESTS | 6 | 171 | 0 | ||
255400238 | jiminaseinen | D | April 7, 2024, 1:22 a.m. | OK | Java 8 | TESTS | 6 | 171 | 0 | ||
255359143 | radianite2003 | D | April 6, 2024, 5:32 p.m. | OK | Java 8 | TESTS | 6 | 171 | 0 | ||
255370763 | smsh.7 | D | April 6, 2024, 7:07 p.m. | OK | Kotlin 1.9 | TESTS | 6 | 171 | 102400 | ||
255358086 | aditya_coder07 | D | April 6, 2024, 5:30 p.m. | OK | PHP | TESTS | 6 | 124 | 307200 | ||
255380706 | logankeede | D | April 6, 2024, 8:33 p.m. | OK | PyPy 3 | TESTS | 6 | 93 | 1536000 | ||
255365210 | ashays | D | April 6, 2024, 6:27 p.m. | OK | PyPy 3 | TESTS | 6 | 155 | 5222400 | ||
255364891 | dnzc | D | April 6, 2024, 6:25 p.m. | OK | PyPy 3 | TESTS | 6 | 186 | 5017600 | ||
255365547 | bunny_senpai | D | April 6, 2024, 6:29 p.m. | OK | PyPy 3 | TESTS | 6 | 187 | 5222400 | ||
255388108 | SoleProprietor | D | April 6, 2024, 9:55 p.m. | OK | PyPy 3-64 | TESTS | 6 | 77 | 0 | ||
255380480 | AloFrut | D | April 6, 2024, 8:31 p.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 4608000 | ||
255387477 | tfgs | D | April 6, 2024, 9:47 p.m. | OK | PyPy 3-64 | TESTS | 6 | 108 | 4915200 | ||
255411307 | _twi_nami | D | April 7, 2024, 4:17 a.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 5017600 | ||
255374775 | sushmanth.dampur8780 | D | April 6, 2024, 7:40 p.m. | OK | PyPy 3-64 | TESTS | 6 | 109 | 5427200 | ||
255405985 | mikeac | D | April 7, 2024, 2:59 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 5324800 | ||
255402164 | rien | D | April 7, 2024, 1:56 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 5324800 | ||
255406759 | voicon | D | April 7, 2024, 3:13 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 5836800 | ||
255406450 | codeTester9487 | D | April 7, 2024, 3:07 a.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 5836800 | ||
255355138 | Iamsadscam01 | D | April 6, 2024, 5:23 p.m. | OK | PyPy 3-64 | TESTS | 6 | 124 | 6041600 | ||
255366723 | OLOGY | D | April 6, 2024, 6:36 p.m. | OK | Python 2 | TESTS | 6 | 77 | 0 | ||
255392630 | ZarthaxX | D | April 6, 2024, 11:02 p.m. | OK | Python 3 | TESTS | 6 | 62 | 0 | ||
255366603 | NGPNAN | D | April 6, 2024, 6:35 p.m. | OK | Python 3 | TESTS | 6 | 62 | 102400 | ||
255365166 | r-tron18 | D | April 6, 2024, 6:27 p.m. | OK | Python 3 | TESTS | 6 | 62 | 102400 | ||
255374843 | Kashaf_Anwar | D | April 6, 2024, 7:40 p.m. | OK | Python 3 | TESTS | 6 | 77 | 0 | ||
255355506 | skdm4199 | D | April 6, 2024, 5:23 p.m. | OK | Python 3 | TESTS | 6 | 77 | 102400 | ||
255359363 | sabbirahmeds877 | D | April 6, 2024, 5:33 p.m. | OK | Python 3 | TESTS | 6 | 78 | 102400 | ||
255364642 | Slata | D | April 6, 2024, 6:24 p.m. | OK | Python 3 | TESTS | 6 | 92 | 0 | ||
255359018 | akshitsharma1 | D | April 6, 2024, 5:32 p.m. | OK | Python 3 | TESTS | 6 | 93 | 102400 | ||
255384985 | vstiff | D | April 6, 2024, 9:17 p.m. | OK | Rust 2021 | TESTS | 6 | 61 | 0 | ||
255358655 | paugh00001 | D | April 6, 2024, 5:31 p.m. | OK | Rust 2021 | TESTS | 6 | 61 | 0 | ||
255367170 | liut | D | April 6, 2024, 6:39 p.m. | OK | Rust 2021 | TESTS | 6 | 77 | 102400 |
Back to search problems