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 |
---|---|---|---|---|---|---|
1904 | Codeforces Round 914 (Div. 2) | FINISHED | False | 7200 | 29685299 | Dec. 9, 2023, 4:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 13577 ) | C | Array Game | PROGRAMMING | binary search brute force data structures sortings |
B'You are given an array a of n positive integers. In one operation, you must pick some (i, j) such that 1 <= q i < j <= q |a| and append |a_i - a_j| to the end of the a (i.e. increase n by 1 and set a_n to |a_i - a_j| ). Your task is to minimize and print the minimum value of a after performing k operations. Each test contains multiple test cases. The first line contains an integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n and k ( 2 <= n <= 2 cdot 10^3 , 1 <= k <= 10^9 ) -- the length of the array and the number of operations you should perform. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^{18} ) -- the elements of the array a . It is guaranteed that the sum of n^2 over all test cases does not exceed 4 cdot 10^6 . For each test case, print a single integer -- the smallest possible value of the minimum of array a after performing k operations. In the first test case, after any k=2 operations, the minimum value of a will be 1 . In the second test case, an optimal strategy is to first pick i=1, j=2 and append |a_1 - a_2| = 3 to the end of a , creating a=[7, 4, 15, 12, 3] . Then, pick i=3, j=4 and append |a_3 - a_4| = 3 to the end of a , creating a=[7, 4, 15, 12, 3, 3] . In the final operation, pick i=5, j=6 and append |a_5 - a_6| = 0 to the end of a . Then the minimum value of a will be 0 . In the third test case, an optimal strategy is to first pick i=2, j=3 to append |a_2 - a_3| = 3 to the end of a . Any second operation will still not make the minimum value of a be less than 3 . '... |
Codeforces Round 914 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
236583763 | ruban | C | Dec. 9, 2023, 7:47 p.m. | OK | FPC | TESTS | 8 | 46 | 167014400 | ||
236564066 | eastnman | C | Dec. 9, 2023, 5:46 p.m. | OK | FPC | TESTS | 8 | 311 | 16486400 | ||
236593686 | mithjain059 | C | Dec. 9, 2023, 9:35 p.m. | OK | GNU C++14 | TESTS | 8 | 31 | 0 | ||
236563589 | manasagarwal129 | C | Dec. 9, 2023, 5:44 p.m. | OK | GNU C++14 | TESTS | 8 | 31 | 0 | ||
236611041 | marcus06 | C | Dec. 10, 2023, 4:48 a.m. | OK | GNU C++14 | TESTS | 10 | 46 | 0 | ||
236605718 | golemon | C | Dec. 10, 2023, 3:03 a.m. | OK | GNU C++14 | TESTS | 10 | 62 | 0 | ||
236590651 | liveInTheMoment | C | Dec. 9, 2023, 9:05 p.m. | OK | GNU C++14 | TESTS | 8 | 62 | 0 | ||
236573689 | Joacru | C | Dec. 9, 2023, 6:20 p.m. | OK | GNU C++14 | TESTS | 8 | 77 | 307200 | ||
236610520 | LUXINTONG | C | Dec. 10, 2023, 4:39 a.m. | OK | GNU C++14 | TESTS | 10 | 78 | 0 | ||
236589973 | chomotngayloihuanohoa | C | Dec. 9, 2023, 8:53 p.m. | OK | GNU C++14 | TESTS | 8 | 78 | 0 | ||
236582502 | sherifmesba | C | Dec. 9, 2023, 7:33 p.m. | OK | GNU C++14 | TESTS | 8 | 78 | 0 | ||
236578976 | utsav03 | C | Dec. 9, 2023, 6:56 p.m. | OK | GNU C++14 | TESTS | 8 | 78 | 0 | ||
236574091 | sdyakonov | C | Dec. 9, 2023, 6:23 p.m. | OK | GNU C++17 | TESTS | 8 | 31 | 0 | ||
236565137 | sitiy | C | Dec. 9, 2023, 5:49 p.m. | OK | GNU C++17 | TESTS | 8 | 31 | 819200 | ||
236602442 | beautifullife | C | Dec. 10, 2023, 1:44 a.m. | OK | GNU C++17 | TESTS | 8 | 46 | 0 | ||
236581972 | ttakk | C | Dec. 9, 2023, 7:27 p.m. | OK | GNU C++17 | TESTS | 8 | 46 | 0 | ||
236575843 | Danth575 | C | Dec. 9, 2023, 6:32 p.m. | OK | GNU C++17 | TESTS | 8 | 46 | 0 | ||
236565988 | AlexanderL | C | Dec. 9, 2023, 5:51 p.m. | OK | GNU C++17 | TESTS | 8 | 46 | 0 | ||
236561340 | Korkej | C | Dec. 9, 2023, 5:38 p.m. | OK | GNU C++17 | TESTS | 8 | 46 | 0 | ||
236571410 | Geanina_the_Great | C | Dec. 9, 2023, 6:04 p.m. | OK | GNU C++17 | TESTS | 8 | 46 | 819200 | ||
236576986 | prem_1 | C | Dec. 9, 2023, 6:40 p.m. | OK | GNU C++17 | TESTS | 8 | 61 | 307200 | ||
236590416 | DaniilPl | C | Dec. 9, 2023, 9 p.m. | OK | GNU C++17 | TESTS | 8 | 62 | 0 | ||
236579521 | 9331rzy | C | Dec. 9, 2023, 7:01 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 31 | 0 | ||
236615534 | KostyR13 | C | Dec. 10, 2023, 5:53 a.m. | OK | GNU C++17 (64) | TESTS | 10 | 46 | 0 | ||
236567207 | SSRS_ | C | Dec. 9, 2023, 5:54 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 46 | 0 | ||
236609142 | fzyz2020 | C | Dec. 10, 2023, 4:13 a.m. | OK | GNU C++17 (64) | TESTS | 10 | 62 | 0 | ||
236606836 | 3449 | C | Dec. 10, 2023, 3:28 a.m. | OK | GNU C++17 (64) | TESTS | 10 | 62 | 0 | ||
236600072 | akwa_blue | C | Dec. 10, 2023, 12:26 a.m. | OK | GNU C++17 (64) | TESTS | 8 | 62 | 0 | ||
236593857 | amiran | C | Dec. 9, 2023, 9:39 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 62 | 0 | ||
236586417 | chaoyouqian | C | Dec. 9, 2023, 8:19 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 62 | 0 | ||
236576258 | Heisenburg-120 | C | Dec. 9, 2023, 6:34 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 62 | 0 | ||
236575806 | Alfa | C | Dec. 9, 2023, 6:31 p.m. | OK | GNU C++17 (64) | TESTS | 8 | 62 | 0 | ||
236605434 | sachin_gupta21 | C | Dec. 10, 2023, 2:58 a.m. | OK | GNU C++20 (64) | TESTS | 10 | 15 | 0 | ||
236603620 | luckmaster | C | Dec. 10, 2023, 2:16 a.m. | OK | GNU C++20 (64) | TESTS | 10 | 31 | 0 | ||
236578742 | nfrmtk_aka_fakoff_ka | C | Dec. 9, 2023, 6:54 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
236563361 | AndrewDJ | C | Dec. 9, 2023, 5:44 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 31 | 0 | ||
236614951 | ci_pher | C | Dec. 10, 2023, 5:46 a.m. | OK | GNU C++20 (64) | TESTS | 10 | 46 | 0 | ||
236610233 | yunowe | C | Dec. 10, 2023, 4:33 a.m. | OK | GNU C++20 (64) | TESTS | 10 | 46 | 0 | ||
236580146 | hayagrivan.dj | C | Dec. 9, 2023, 7:07 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 46 | 0 | ||
236579915 | ItzDesert | C | Dec. 9, 2023, 7:05 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 46 | 0 | ||
236579143 | lord_frieza | C | Dec. 9, 2023, 6:58 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 46 | 0 | ||
236577058 | manan_4 | C | Dec. 9, 2023, 6:40 p.m. | OK | GNU C++20 (64) | TESTS | 8 | 46 | 0 | ||
236561240 | mr_sparkle70 | C | Dec. 9, 2023, 5:38 p.m. | OK | Go | TESTS | 8 | 514 | 819200 | ||
236613403 | itsdevine | C | Dec. 10, 2023, 5:25 a.m. | OK | Java 11 | TESTS | 10 | 311 | 0 | ||
236599072 | Clementine96 | C | Dec. 9, 2023, 11:48 p.m. | OK | Java 11 | TESTS | 8 | 358 | 0 | ||
236588190 | GR1ZLER | C | Dec. 9, 2023, 8:28 p.m. | OK | Java 11 | TESTS | 8 | 420 | 0 | ||
236575203 | newbornLingling0423 | C | Dec. 9, 2023, 6:28 p.m. | OK | Java 11 | TESTS | 8 | 467 | 0 | ||
236590379 | PlayDate | C | Dec. 9, 2023, 9 p.m. | OK | Java 11 | TESTS | 8 | 483 | 0 | ||
236573460 | WORTH | C | Dec. 9, 2023, 6:19 p.m. | OK | Java 11 | TESTS | 8 | 530 | 0 | ||
236574974 | newbornLingling0423 | C | Dec. 9, 2023, 6:27 p.m. | OK | Java 11 | TESTS | 8 | 560 | 0 | ||
236569052 | fpeterfalvi | C | Dec. 9, 2023, 5:59 p.m. | OK | Java 11 | TESTS | 8 | 577 | 0 | ||
236577393 | kasiru_69 | C | Dec. 9, 2023, 6:43 p.m. | OK | Java 11 | TESTS | 8 | 702 | 0 | ||
236605867 | EricM08 | C | Dec. 10, 2023, 3:07 a.m. | OK | Java 11 | TESTS | 10 | 795 | 65536000 | ||
236578270 | 28leoleo28 | C | Dec. 9, 2023, 6:50 p.m. | OK | Java 17 | TESTS | 8 | 483 | 614400 | ||
236604715 | dilshar23 | C | Dec. 10, 2023, 2:41 a.m. | OK | Java 17 | TESTS | 10 | 577 | 512000 | ||
236569866 | BrisS | C | Dec. 9, 2023, 6:01 p.m. | OK | Java 17 | TESTS | 8 | 717 | 409600 | ||
236592053 | Harwinvanak | C | Dec. 9, 2023, 9:10 p.m. | OK | Java 17 | TESTS | 8 | 748 | 307200 | ||
236582947 | codeanand17 | C | Dec. 9, 2023, 7:38 p.m. | OK | Java 17 | TESTS | 8 | 748 | 819200 | ||
236604038 | GaleStarr | C | Dec. 10, 2023, 2:26 a.m. | OK | Java 17 | TESTS | 10 | 872 | 95232000 | ||
236578066 | dineshchandran311 | C | Dec. 9, 2023, 6:48 p.m. | OK | Java 17 | TESTS | 8 | 935 | 512000 | ||
236572674 | susvant | C | Dec. 9, 2023, 6:17 p.m. | OK | Java 21 | TESTS | 8 | 311 | 0 | ||
236564702 | AgnivS | C | Dec. 9, 2023, 5:47 p.m. | OK | Java 21 | TESTS | 8 | 390 | 16076800 | ||
236561798 | SamyajitDas | C | Dec. 9, 2023, 5:39 p.m. | OK | Java 21 | TESTS | 8 | 733 | 0 | ||
236567723 | 67mnjhgfqwer | C | Dec. 9, 2023, 5:55 p.m. | OK | Java 21 | TESTS | 8 | 810 | 0 | ||
236580632 | Sumitsingh7 | C | Dec. 9, 2023, 7:12 p.m. | OK | Java 8 | TESTS | 8 | 358 | 6144000 | ||
236580167 | Sumitsingh7 | C | Dec. 9, 2023, 7:08 p.m. | OK | Java 8 | TESTS | 8 | 358 | 6144000 | ||
236567532 | MintCat | C | Dec. 9, 2023, 5:55 p.m. | OK | Java 8 | TESTS | 8 | 421 | 0 | ||
236582001 | Danger_Don | C | Dec. 9, 2023, 7:27 p.m. | OK | Java 8 | TESTS | 8 | 514 | 0 | ||
236576341 | NerfThis | C | Dec. 9, 2023, 6:35 p.m. | OK | Java 8 | TESTS | 8 | 530 | 0 | ||
236562128 | formidablechief_27 | C | Dec. 9, 2023, 5:40 p.m. | OK | Java 8 | TESTS | 8 | 873 | 68096000 | ||
236567139 | Akarsh2810 | C | Dec. 9, 2023, 5:54 p.m. | OK | Java 8 | TESTS | 8 | 935 | 63590400 | ||
236574230 | iuxan | C | Dec. 9, 2023, 6:23 p.m. | OK | MS C++ 2017 | TESTS | 8 | 93 | 0 | ||
236562647 | Triss_Merigold | C | Dec. 9, 2023, 5:42 p.m. | OK | MS C++ 2017 | TESTS | 8 | 93 | 0 | ||
236605222 | andy562.dlg | C | Dec. 10, 2023, 2:53 a.m. | OK | MS C++ 2017 | TESTS | 10 | 93 | 102400 | ||
236568816 | rajat_guptaa | C | Dec. 9, 2023, 5:58 p.m. | OK | MS C++ 2017 | TESTS | 8 | 155 | 102400 | ||
236571188 | Mukul_singh16 | C | Dec. 9, 2023, 6:04 p.m. | OK | MS C++ 2017 | TESTS | 8 | 156 | 102400 | ||
236580981 | skimono | C | Dec. 9, 2023, 7:16 p.m. | OK | MS C++ 2017 | TESTS | 8 | 202 | 31641600 | ||
236577232 | ahtoh_ | C | Dec. 9, 2023, 6:42 p.m. | OK | Node.js | TESTS | 8 | 951 | 4198400 | ||
236609980 | vsvg | C | Dec. 10, 2023, 4:28 a.m. | OK | PyPy 3 | TESTS | 10 | 592 | 4505600 | ||
236562791 | a5a7 | C | Dec. 9, 2023, 5:42 p.m. | OK | PyPy 3 | TESTS | 8 | 685 | 6348800 | ||
236573533 | jvatsal0709 | C | Dec. 9, 2023, 6:19 p.m. | OK | PyPy 3 | TESTS | 8 | 779 | 4505600 | ||
236567878 | utrpatzer | C | Dec. 9, 2023, 5:56 p.m. | OK | PyPy 3 | TESTS | 8 | 888 | 6451200 | ||
236564668 | satvik777 | C | Dec. 9, 2023, 5:47 p.m. | OK | PyPy 3 | TESTS | 8 | 1278 | 6656000 | ||
236576690 | Zappricious | C | Dec. 9, 2023, 6:37 p.m. | OK | PyPy 3 | TESTS | 8 | 1528 | 139673600 | ||
236569190 | vainlab | C | Dec. 9, 2023, 5:59 p.m. | OK | PyPy 3 | TESTS | 8 | 1731 | 225177600 | ||
236574567 | amitjoshi24 | C | Dec. 9, 2023, 6:25 p.m. | OK | PyPy 3 | TESTS | 8 | 1965 | 185958400 | ||
236598404 | HectorHW | C | Dec. 9, 2023, 11:26 p.m. | OK | PyPy 3-64 | TESTS | 8 | 170 | 8396800 | ||
236580563 | onelasttime99 | C | Dec. 9, 2023, 7:12 p.m. | OK | PyPy 3-64 | TESTS | 8 | 186 | 9932800 | ||
236575397 | abc_2002 | C | Dec. 9, 2023, 6:29 p.m. | OK | PyPy 3-64 | TESTS | 8 | 233 | 4505600 | ||
236593149 | Mustela_Erminea | C | Dec. 9, 2023, 9:27 p.m. | OK | PyPy 3-64 | TESTS | 8 | 280 | 5529600 | ||
236576096 | KawaiiNahida | C | Dec. 9, 2023, 6:33 p.m. | OK | PyPy 3-64 | TESTS | 8 | 280 | 8704000 | ||
236580555 | AlexFives | C | Dec. 9, 2023, 7:12 p.m. | OK | PyPy 3-64 | TESTS | 8 | 280 | 9523200 | ||
236575846 | vrasp | C | Dec. 9, 2023, 6:32 p.m. | OK | PyPy 3-64 | TESTS | 8 | 280 | 28979200 | ||
236573757 | AyuAnchor | C | Dec. 9, 2023, 6:20 p.m. | OK | PyPy 3-64 | TESTS | 8 | 295 | 6758400 | ||
236583767 | CaiMark | C | Dec. 9, 2023, 7:47 p.m. | OK | PyPy 3-64 | TESTS | 8 | 295 | 9830400 | ||
236585909 | yaroslav_pos | C | Dec. 9, 2023, 8:12 p.m. | OK | PyPy 3-64 | TESTS | 8 | 296 | 6041600 | ||
236615508 | heisenberg6 | C | Dec. 10, 2023, 5:53 a.m. | OK | Python 3 | TESTS | 10 | 873 | 110182400 | ||
236574085 | heisenberg6 | C | Dec. 9, 2023, 6:23 p.m. | OK | Python 3 | TESTS | 8 | 1075 | 97996800 | ||
236561626 | suuuukalaaaaaaaaaass | C | Dec. 9, 2023, 5:39 p.m. | OK | Python 3 | TESTS | 8 | 1200 | 204800 | ||
236562607 | sh1ziku | C | Dec. 9, 2023, 5:42 p.m. | OK | Python 3 | TESTS | 8 | 1622 | 204800 | ||
236567865 | whereiswhen | C | Dec. 9, 2023, 5:56 p.m. | OK | Python 3 | TESTS | 8 | 1699 | 921600 | ||
236570250 | Redpanda_x | C | Dec. 9, 2023, 6:02 p.m. | OK | Python 3 | TESTS | 8 | 1981 | 204800 | ||
236603450 | liut | C | Dec. 10, 2023, 2:12 a.m. | OK | Rust 2021 | TESTS | 9 | 93 | 0 | ||
236578554 | Loganwick | C | Dec. 9, 2023, 6:52 p.m. | OK | Rust 2021 | TESTS | 8 | 93 | 102400 | ||
236578026 | Loganwick | C | Dec. 9, 2023, 6:48 p.m. | OK | Rust 2021 | TESTS | 8 | 93 | 102400 | ||
236606215 | points_engineering | C | Dec. 10, 2023, 3:15 a.m. | OK | Rust 2021 | TESTS | 10 | 93 | 26726400 | ||
236603380 | liut | C | Dec. 10, 2023, 2:10 a.m. | OK | Rust 2021 | TESTS | 9 | 109 | 0 | ||
236561718 | PeterlitsZo | C | Dec. 9, 2023, 5:39 p.m. | OK | Rust 2021 | TESTS | 8 | 202 | 307200 | ||
236589767 | vstiff | C | Dec. 9, 2023, 8:50 p.m. | OK | Rust 2021 | TESTS | 8 | 529 | 33177600 |
Back to search problems