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 |
---|---|---|---|---|---|---|
721 | Codeforces Round 374 (Div. 2) | FINISHED | False | 7200 | 256578899 | Sept. 30, 2016, 2:05 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 2355 ) | D | Maxim and Array | PROGRAMMING | constructive algorithms data structures greedy math | 2000 |
B'Recently Maxim has found an array of n integers, needed by no one. He immediately come up with idea of changing it: he invented positive integer x and decided to add or subtract it from arbitrary array elements. Formally, by applying single operation Maxim chooses integer i (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n) and replaces the i-th element of array ai either with ai xe2 x80 x89+ xe2 x80 x89x or with ai xe2 x80 x89- xe2 x80 x89x. Please note that the operation may be applied more than once to the same position. Maxim is a curious minimalis, thus he wants to know what is the minimum value that the product of all array elements (i.e. ) can reach, if Maxim would apply no more than k operations to it. Please help him in that. The first line of the input contains three integers n, xe2 x80 x89k and x (1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, xe2 x80 x89k xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89200 xe2 x80 x89000, xe2 x80 x891 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89x xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89109) -- the number of elements in the array, the maximum number of operations and the number invented by Maxim, respectively. The second line contains n integers a1, xe2 x80 x89a2, xe2 x80 x89..., xe2 x80 x89an () -- the elements of the array found by Maxim. Print n integers b1, xe2 x80 x89b2, xe2 x80 x89..., xe2 x80 x89bn in the only line -- the array elements after applying no more than k operations to the array. In particular, should stay true for every 1 xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89i xe2 x80 x89 xe2 x89 xa4 xe2 x80 x89n, but the product of all array elements should be minimum possible. If there are multiple answers, print any of them. '... |
Codeforces Round #374 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
21367408 | FalseMirror | D | Oct. 11, 2016, 6:45 p.m. | OK | D | TESTS | 70 | 545 | 46284800 | 2000 | |
21257781 | harleluyar | D | Oct. 7, 2016, 12:42 p.m. | OK | FPC | TESTS | 70 | 530 | 6553600 | 2000 | |
21340695 | Gray_58 | D | Oct. 10, 2016, 2:59 p.m. | OK | FPC | TESTS | 70 | 530 | 7577600 | 2000 | |
21451915 | piihanose | D | Oct. 15, 2016, 10:37 a.m. | OK | FPC | TESTS | 70 | 545 | 4096000 | 2000 | |
21254717 | abcdef6199 | D | Oct. 7, 2016, 10:08 a.m. | OK | FPC | TESTS | 70 | 733 | 6553600 | 2000 | |
52674848 | chaorenhaha | D | April 13, 2019, 9:06 a.m. | OK | FPC | TESTS | 70 | 748 | 4812800 | 2000 | |
21408988 | yan_lazy | D | Oct. 13, 2016, 5:29 p.m. | OK | FPC | TESTS | 70 | 842 | 3993600 | 2000 | |
21067995 | xzyxzy | D | Oct. 1, 2016, 11:58 a.m. | OK | GNU C++ | TESTS | 70 | 124 | 7884800 | 2000 | |
40983554 | ReaLNero1 | D | July 30, 2018, 6:55 p.m. | OK | GNU C++ | TESTS | 70 | 124 | 7987200 | 2000 | |
21054798 | E.Space | D | Oct. 1, 2016, 2:54 a.m. | OK | GNU C++ | TESTS | 70 | 124 | 7987200 | 2000 | |
21110259 | HeZiying | D | Oct. 2, 2016, 9:13 a.m. | OK | GNU C++ | TESTS | 70 | 139 | 7782400 | 2000 | |
40461582 | luogu_bot4 | D | July 17, 2018, 4:22 a.m. | OK | GNU C++ | TESTS | 70 | 139 | 7884800 | 2000 | |
26991182 | bhaag_milkha | D | May 10, 2017, 7:01 a.m. | OK | GNU C++ | TESTS | 70 | 140 | 8806400 | 2000 | |
21109151 | chentong | D | Oct. 2, 2016, 8:24 a.m. | OK | GNU C++ | TESTS | 70 | 155 | 3072000 | 2000 | |
21068719 | liukeya | D | Oct. 1, 2016, 12:30 p.m. | OK | GNU C++ | TESTS | 70 | 155 | 7884800 | 2000 | |
21068829 | liukeya | D | Oct. 1, 2016, 12:35 p.m. | OK | GNU C++ | TESTS | 70 | 155 | 7884800 | 2000 | |
21328508 | TerryHu | D | Oct. 10, 2016, 12:20 a.m. | OK | GNU C++ | TESTS | 70 | 155 | 10137600 | 2000 | |
57064557 | rainboy | D | July 14, 2019, 8:15 p.m. | OK | GNU C11 | TESTS | 70 | 795 | 3993600 | 2000 | |
21208280 | yukihana0416 | D | Oct. 5, 2016, 12:37 p.m. | OK | GNU C++11 | TESTS | 70 | 140 | 7884800 | 2000 | |
67310220 | lszxj | D | Dec. 21, 2019, 2:04 a.m. | OK | GNU C++11 | TESTS | 70 | 155 | 7782400 | 2000 | |
40433339 | sunny_fei | D | July 16, 2018, 3:40 p.m. | OK | GNU C++11 | TESTS | 70 | 155 | 7884800 | 2000 | |
57745590 | vjudge3 | D | July 25, 2019, 12:54 p.m. | OK | GNU C++11 | TESTS | 70 | 155 | 7884800 | 2000 | |
21055089 | JamesQi | D | Oct. 1, 2016, 3:13 a.m. | OK | GNU C++11 | TESTS | 70 | 155 | 8089600 | 2000 | |
25946570 | vjudge3 | D | March 30, 2017, 9:13 a.m. | OK | GNU C++11 | TESTS | 70 | 155 | 10547200 | 2000 | |
21133871 | s_p | D | Oct. 3, 2016, 10:27 a.m. | OK | GNU C++11 | TESTS | 70 | 156 | 3174400 | 2000 | |
27282448 | buctacm2 | D | May 22, 2017, 11:12 a.m. | OK | GNU C++11 | TESTS | 70 | 156 | 3686400 | 2000 | |
57732544 | vjudge3 | D | July 25, 2019, 8:59 a.m. | OK | GNU C++11 | TESTS | 70 | 156 | 7884800 | 2000 | |
57735731 | vjudge1 | D | July 25, 2019, 9:53 a.m. | OK | GNU C++11 | TESTS | 70 | 156 | 7884800 | 2000 | |
52329683 | nong | D | April 5, 2019, 4:19 a.m. | OK | GNU C++14 | TESTS | 70 | 155 | 7987200 | 2000 | |
21069527 | Al3ks1002 | D | Oct. 1, 2016, 1:05 p.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7884800 | 2000 | |
60706462 | marksman_ | D | Sept. 17, 2019, 5:33 a.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7884800 | 2000 | |
57745110 | xufour | D | July 25, 2019, 12:45 p.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7987200 | 2000 | |
57725086 | vjudge1 | D | July 25, 2019, 6:53 a.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7987200 | 2000 | |
55673259 | Ada.Grad.Shil | D | June 17, 2019, 8:55 a.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7987200 | 2000 | |
55065631 | khaled.farouk_2 | D | June 4, 2019, 3:23 a.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7987200 | 2000 | |
27114699 | JoseAcv2 | D | May 15, 2017, 2:42 a.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7987200 | 2000 | |
59885378 | _no0B | D | Sept. 2, 2019, 7:39 a.m. | OK | GNU C++14 | TESTS | 70 | 171 | 7987200 | 2000 | |
34638790 | jslijin | D | Jan. 28, 2018, 4:41 p.m. | OK | GNU C++14 | TESTS | 70 | 171 | 9830400 | 2000 | |
57726036 | vjudge3 | D | July 25, 2019, 7:11 a.m. | OK | GNU C++17 | TESTS | 70 | 155 | 7987200 | 2000 | |
57727420 | vjudge4 | D | July 25, 2019, 7:35 a.m. | OK | GNU C++17 | TESTS | 70 | 171 | 7987200 | 2000 | |
57732197 | vjudge1 | D | July 25, 2019, 8:54 a.m. | OK | GNU C++17 | TESTS | 70 | 171 | 8704000 | 2000 | |
57729273 | vjudge2 | D | July 25, 2019, 8:06 a.m. | OK | GNU C++17 | TESTS | 70 | 186 | 3174400 | 2000 | |
56746750 | DystoriaX | D | July 9, 2019, 10:05 a.m. | OK | GNU C++17 | TESTS | 70 | 186 | 7987200 | 2000 | |
57724987 | 90n | D | July 25, 2019, 6:51 a.m. | OK | GNU C++17 | TESTS | 70 | 186 | 7987200 | 2000 | |
46414100 | arpit040199 | D | Nov. 30, 2018, 6:25 p.m. | OK | GNU C++17 | TESTS | 70 | 186 | 7987200 | 2000 | |
56039094 | igba | D | June 25, 2019, 1:28 p.m. | OK | GNU C++17 | TESTS | 70 | 187 | 3174400 | 2000 | |
57749438 | venkatesh_saki | D | July 25, 2019, 2:15 p.m. | OK | GNU C++17 | TESTS | 70 | 187 | 7987200 | 2000 | |
64131097 | k24 | D | Nov. 3, 2019, 6:52 a.m. | OK | GNU C++17 | TESTS | 70 | 187 | 7987200 | 2000 | |
28287912 | S.Jindal | D | July 4, 2017, 7:04 p.m. | OK | Java 8 | TESTS | 70 | 343 | 28467200 | 2000 | |
22077968 | RP_9 | D | Nov. 6, 2016, 3:27 p.m. | OK | Java 8 | TESTS | 70 | 389 | 4812800 | 2000 | |
21102124 | miguelmaurizio | D | Oct. 1, 2016, 10:55 p.m. | OK | Java 8 | TESTS | 70 | 405 | 13721600 | 2000 | |
68108224 | yaoct | D | Jan. 3, 2020, 8:18 a.m. | OK | Java 8 | TESTS | 70 | 405 | 15155200 | 2000 | |
21057074 | wolfib | D | Oct. 1, 2016, 5:22 a.m. | OK | Java 8 | TESTS | 70 | 421 | 13516800 | 2000 | |
21218938 | alibaba | D | Oct. 5, 2016, 6:12 p.m. | OK | Java 8 | TESTS | 70 | 421 | 14643200 | 2000 | |
21130900 | megaspazz | D | Oct. 3, 2016, 7:54 a.m. | OK | Java 8 | TESTS | 70 | 436 | 14336000 | 2000 | |
21130996 | megaspazz | D | Oct. 3, 2016, 7:58 a.m. | OK | Java 8 | TESTS | 70 | 452 | 14336000 | 2000 | |
28287889 | S.Jindal | D | July 4, 2017, 7:03 p.m. | OK | Java 8 | TESTS | 70 | 452 | 27340800 | 2000 | |
36514288 | ZeyadKhattab | D | March 22, 2018, 7:42 p.m. | OK | Java 8 | TESTS | 70 | 452 | 35942400 | 2000 | |
23809115 | og.kostya | D | Jan. 14, 2017, 3:17 p.m. | OK | MS C# | TESTS | 70 | 514 | 15564800 | 2000 | |
21066200 | lilala | D | Oct. 1, 2016, 10:42 a.m. | OK | MS C++ | TESTS | 70 | 171 | 7577600 | 2000 | |
57731600 | vjudge2 | D | July 25, 2019, 8:44 a.m. | OK | MS C++ | TESTS | 70 | 186 | 12390400 | 2000 | |
57727223 | vjudge5 | D | July 25, 2019, 7:32 a.m. | OK | MS C++ | TESTS | 70 | 202 | 72908800 | 2000 | |
57730744 | vjudge2 | D | July 25, 2019, 8:31 a.m. | OK | MS C++ | TESTS | 70 | 217 | 9216000 | 2000 | |
21116790 | Richardzhsh | D | Oct. 2, 2016, 2:02 p.m. | OK | MS C++ | TESTS | 70 | 217 | 10342400 | 2000 | |
21839472 | miagkov | D | Oct. 28, 2016, 5:23 a.m. | OK | MS C++ | TESTS | 70 | 264 | 12697600 | 2000 | |
27966652 | mshcherba | D | June 22, 2017, 1:48 p.m. | OK | MS C++ | TESTS | 70 | 280 | 13414400 | 2000 | |
22167525 | Andreasyan | D | Nov. 11, 2016, 6:02 p.m. | OK | MS C++ | TESTS | 70 | 374 | 7577600 | 2000 | |
21208054 | ferc | D | Oct. 5, 2016, 12:25 p.m. | OK | MS C++ | TESTS | 70 | 374 | 13004800 | 2000 | |
21060761 | Khazhak | D | Oct. 1, 2016, 8:13 a.m. | OK | MS C++ | TESTS | 70 | 390 | 16691200 | 2000 | |
57735420 | vjudge3 | D | July 25, 2019, 9:48 a.m. | OK | MS C++ 2017 | TESTS | 70 | 202 | 9216000 | 2000 | |
21637142 | SIackbot | D | Oct. 21, 2016, 9:07 a.m. | OK | PyPy 2 | TESTS | 70 | 1949 | 24883200 | 2000 | |
66169001 | jdbermeol | D | Dec. 2, 2019, 9:17 a.m. | OK | PyPy 3 | TESTS | 70 | 1434 | 42086400 | 2000 | |
44346219 | aarish | D | Oct. 15, 2018, 7:28 a.m. | OK | PyPy 3 | TESTS | 70 | 1481 | 29798400 | 2000 | |
21373146 | gahou | D | Oct. 12, 2016, 4:37 a.m. | OK | Python 2 | TESTS | 70 | 1294 | 33689600 | 2000 | |
21323704 | orailly | D | Oct. 9, 2016, 5:28 p.m. | OK | Python 3 | TESTS | 70 | 1060 | 39116800 | 2000 | |
66013834 | NocturneBflat | D | Nov. 30, 2019, 4:18 a.m. | OK | Python 3 | TESTS | 70 | 1138 | 44851200 | 2000 | |
21278435 | Bryan1220 | D | Oct. 8, 2016, 11:10 a.m. | OK | Python 3 | TESTS | 70 | 1403 | 45670400 | 2000 | |
32733451 | yugle7 | D | Nov. 27, 2017, 7:07 p.m. | OK | Python 3 | TESTS | 70 | 1684 | 32870400 | 2000 | |
21122719 | sianqville | D | Oct. 2, 2016, 6:36 p.m. | OK | Python 3 | TESTS | 70 | 1996 | 48435200 | 2000 | |
22414461 | reldan | D | Nov. 23, 2016, 12:45 a.m. | OK | Scala | TESTS | 70 | 1122 | 22220800 | 2000 |
Back to search problems