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 |
---|---|---|---|---|---|---|
1872 | Codeforces Round 895 (Div. 3) | FINISHED | False | 8100 | 43082663 | Sept. 7, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 4421 ) | G | Replace With Product | PROGRAMMING | brute force math two pointers |
B'Given an array a of n positive integers. You need to perform the following operation exactly once: For example, if an operation with parameters l = 2, r = 4 is applied to the array [5, 4, 3, 2, 1] , the array will turn into [5, 24, 1] . Your task is to maximize the sum of the array after applying this operation. Find the optimal subarray to apply this operation. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. This is followed by the description of the test cases. The first line of each test case contains a single number n ( 1 <= n <= 2 cdot 10^5 ) -- the length of the array a . The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= a_i <= 10^9 ). It is guaranteed that the sum of the values of n for all test cases does not exceed 2 cdot 10^5 . For each test case, output 2 integers l and r ( 1 <= l <= r <= n ) -- the boundaries of the subarray to be replaced with the product. If there are multiple solutions, output any of them. In the first test case, after applying the operation with parameters l = 2, r = 4 , the array [1, 3, 1, 3] turns into [1, 9] , with a sum equal to 10 . It is easy to see that by replacing any other segment with a product, the sum will be less than 10 . In the second test case, after applying the operation with parameters l = 3, r = 4 , the array [1, 1, 2, 3] turns into [1, 1, 6] , with a sum equal to 8 . It is easy to see that by replacing any other segment with a product, the sum will be less than 8 . In the third test case, it will be optimal to choose any operation with l = r , then the sum of the array will remain 5 , and when applying any other operation, the sum of the array will decrease. '... |
Codeforces Round 895 (Div. 3) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
222385688 | SKAPhantom | G | Sept. 8, 2023, 2:28 a.m. | OK | D | TESTS | 40 | 77 | 24268800 | ||
222362931 | ruban | G | Sept. 7, 2023, 7:13 p.m. | OK | FPC | TESTS | 40 | 77 | 74547200 | ||
222379228 | Lihg | G | Sept. 8, 2023, 12:05 a.m. | OK | GNU C++14 | TESTS | 40 | 46 | 819200 | ||
222383649 | KanzouYamashiro | G | Sept. 8, 2023, 1:50 a.m. | OK | GNU C++14 | TESTS | 40 | 61 | 5017600 | ||
222400199 | santanhuahewu | G | Sept. 8, 2023, 5:48 a.m. | OK | GNU C++14 | TESTS | 58 | 62 | 1638400 | ||
222366962 | God_Of_War_ | G | Sept. 7, 2023, 8:03 p.m. | OK | GNU C++14 | TESTS | 40 | 62 | 1638400 | ||
222398827 | 0wuming0 | G | Sept. 8, 2023, 5:34 a.m. | OK | GNU C++14 | TESTS | 58 | 62 | 1740800 | ||
222383886 | Sherlocked_hzoi | G | Sept. 8, 2023, 1:54 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 3174400 | ||
222381919 | hby2004 | G | Sept. 8, 2023, 1:13 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 3174400 | ||
222380117 | WHSRJ | G | Sept. 8, 2023, 12:27 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 3174400 | ||
222391656 | TrendBattles | G | Sept. 8, 2023, 4:08 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 3993600 | ||
222386274 | chenyanxi | G | Sept. 8, 2023, 2:38 a.m. | OK | GNU C++14 | TESTS | 40 | 62 | 3993600 | ||
222383571 | Ackhava | G | Sept. 8, 2023, 1:48 a.m. | OK | GNU C++17 | TESTS | 40 | 46 | 7782400 | ||
222391265 | solitude3freedom | G | Sept. 8, 2023, 4:02 a.m. | OK | GNU C++17 | TESTS | 40 | 61 | 819200 | ||
222388559 | Linver | G | Sept. 8, 2023, 3:18 a.m. | OK | GNU C++17 | TESTS | 40 | 61 | 3993600 | ||
222391506 | subhankar.banerjee.cse22 | G | Sept. 8, 2023, 4:06 a.m. | OK | GNU C++17 | TESTS | 40 | 61 | 4812800 | ||
222369685 | MarwaMubarak | G | Sept. 7, 2023, 8:40 p.m. | OK | GNU C++17 | TESTS | 40 | 61 | 4812800 | ||
222359615 | egorsa | G | Sept. 7, 2023, 6:36 p.m. | OK | GNU C++17 | TESTS | 40 | 61 | 6451200 | ||
222385706 | AlexFisher | G | Sept. 8, 2023, 2:28 a.m. | OK | GNU C++17 | TESTS | 40 | 61 | 24166400 | ||
222379351 | Ycfhnnd | G | Sept. 8, 2023, 12:08 a.m. | OK | GNU C++17 | TESTS | 40 | 62 | 921600 | ||
222378788 | yswooo | G | Sept. 7, 2023, 11:53 p.m. | OK | GNU C++17 | TESTS | 40 | 62 | 921600 | ||
222391077 | xiaobaibai123 | G | Sept. 8, 2023, 3:59 a.m. | OK | GNU C++17 | TESTS | 40 | 62 | 1638400 | ||
222349584 | AuroraAlaska | G | Sept. 7, 2023, 5:17 p.m. | OK | GNU C++17 (64) | TESTS | 40 | 31 | 7270400 | ||
222386195 | wlh666 | G | Sept. 8, 2023, 2:37 a.m. | OK | GNU C++17 (64) | TESTS | 40 | 31 | 7987200 | ||
222381518 | YaoLingF | G | Sept. 8, 2023, 1:03 a.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 819200 | ||
222381483 | YaoLingF | G | Sept. 8, 2023, 1:02 a.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 819200 | ||
222390253 | Blame.k | G | Sept. 8, 2023, 3:46 a.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 1638400 | ||
222389962 | Blame.k | G | Sept. 8, 2023, 3:41 a.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 1638400 | ||
222389074 | fanhuaxingyu | G | Sept. 8, 2023, 3:27 a.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 1638400 | ||
222377455 | name2 | G | Sept. 7, 2023, 11:16 p.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 2457600 | ||
222367359 | AverageAmogusEnjoyer | G | Sept. 7, 2023, 8:08 p.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 2457600 | ||
222366988 | AverageAmogusEnjoyer | G | Sept. 7, 2023, 8:03 p.m. | OK | GNU C++17 (64) | TESTS | 40 | 46 | 2457600 | ||
222396454 | Wood | G | Sept. 8, 2023, 5:01 a.m. | OK | GNU C++20 (64) | TESTS | 57 | 31 | 819200 | ||
222384945 | CROWJOHN | G | Sept. 8, 2023, 2:15 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222384281 | CROWJOHN | G | Sept. 8, 2023, 2:02 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222383147 | ShiroRinne | G | Sept. 8, 2023, 1:40 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222382851 | Thallium54 | G | Sept. 8, 2023, 1:33 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222380009 | arodnap33 | G | Sept. 8, 2023, 12:25 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222379690 | arodnap33 | G | Sept. 8, 2023, 12:16 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222379594 | arodnap33 | G | Sept. 8, 2023, 12:14 a.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222378212 | lucasxia01 | G | Sept. 7, 2023, 11:36 p.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222371883 | MouayadL7 | G | Sept. 7, 2023, 9:18 p.m. | OK | GNU C++20 (64) | TESTS | 40 | 31 | 819200 | ||
222371998 | dzhi | G | Sept. 7, 2023, 9:20 p.m. | OK | Java 17 | TESTS | 40 | 249 | 4403200 | ||
222371702 | dzhi | G | Sept. 7, 2023, 9:15 p.m. | OK | Java 17 | TESTS | 40 | 249 | 5017600 | ||
222383067 | Mamimi | G | Sept. 8, 2023, 1:38 a.m. | OK | Java 17 | TESTS | 40 | 249 | 7372800 | ||
222370083 | Yousef_Badr | G | Sept. 7, 2023, 8:46 p.m. | OK | Java 17 | TESTS | 40 | 499 | 17920000 | ||
222362708 | Sumitsingh7 | G | Sept. 7, 2023, 7:11 p.m. | OK | Java 8 | TESTS | 40 | 124 | 7782400 | ||
222349931 | Mohamed_Ahmed | G | Sept. 7, 2023, 5:19 p.m. | OK | Java 8 | TESTS | 40 | 155 | 11059200 | ||
222377106 | vatsal_04 | G | Sept. 7, 2023, 11:07 p.m. | OK | Java 8 | TESTS | 40 | 170 | 13209600 | ||
222354864 | sanjayrathva091 | G | Sept. 7, 2023, 5:54 p.m. | OK | Node.js | TESTS | 40 | 217 | 32256000 | ||
222392168 | stan23456 | G | Sept. 8, 2023, 4:15 a.m. | OK | PyPy 3 | TESTS | 40 | 405 | 21504000 | ||
222374189 | SoleProprietor | G | Sept. 7, 2023, 9:59 p.m. | OK | PyPy 3-64 | TESTS | 40 | 109 | 27136000 | ||
222353571 | n_2110030132 | G | Sept. 7, 2023, 5:44 p.m. | OK | PyPy 3-64 | TESTS | 40 | 124 | 30003200 | ||
222360249 | alexwice | G | Sept. 7, 2023, 6:43 p.m. | OK | PyPy 3-64 | TESTS | 40 | 139 | 26931200 | ||
222365445 | Chimpanzee | G | Sept. 7, 2023, 7:44 p.m. | OK | PyPy 3-64 | TESTS | 40 | 155 | 25600000 | ||
222366042 | AyuAnchor | G | Sept. 7, 2023, 7:52 p.m. | OK | PyPy 3-64 | TESTS | 40 | 155 | 26828800 | ||
222366012 | _Malware_ | G | Sept. 7, 2023, 7:51 p.m. | OK | PyPy 3-64 | TESTS | 40 | 155 | 26828800 | ||
222396753 | akifpathan | G | Sept. 8, 2023, 5:05 a.m. | OK | PyPy 3-64 | TESTS | 58 | 155 | 26931200 | ||
222396709 | akifpathan | G | Sept. 8, 2023, 5:05 a.m. | OK | PyPy 3-64 | TESTS | 58 | 155 | 26931200 | ||
222348121 | mikeac | G | Sept. 7, 2023, 5:10 p.m. | OK | PyPy 3-64 | TESTS | 40 | 155 | 28160000 | ||
222376467 | denilb | G | Sept. 7, 2023, 10:50 p.m. | OK | PyPy 3-64 | TESTS | 40 | 171 | 30105600 | ||
222356150 | Joris_Perrenet | G | Sept. 7, 2023, 6:05 p.m. | OK | Python 3 | TESTS | 40 | 186 | 32051200 | ||
222383294 | sami02jain | G | Sept. 8, 2023, 1:42 a.m. | OK | Python 3 | TESTS | 40 | 186 | 46387200 | ||
222350383 | 2110030033 | G | Sept. 7, 2023, 5:22 p.m. | OK | Python 3 | TESTS | 40 | 280 | 30924800 | ||
222392597 | prashastha_11 | G | Sept. 8, 2023, 4:21 a.m. | OK | Python 3 | TESTS | 40 | 295 | 31744000 | ||
222395188 | 21wh1a0222 | G | Sept. 8, 2023, 4:48 a.m. | OK | Python 3 | TESTS | 40 | 311 | 31744000 | ||
222387641 | 2110030158_Nithin | G | Sept. 8, 2023, 3:03 a.m. | OK | Python 3 | TESTS | 40 | 311 | 31744000 | ||
222367172 | rajanlawar_24 | G | Sept. 7, 2023, 8:06 p.m. | OK | Python 3 | TESTS | 40 | 311 | 31744000 | ||
222362934 | sevlll777 | G | Sept. 7, 2023, 7:13 p.m. | OK | Python 3 | TESTS | 40 | 343 | 29184000 | ||
222372494 | vibhorsaxena000 | G | Sept. 7, 2023, 9:28 p.m. | OK | Python 3 | TESTS | 40 | 373 | 27340800 | ||
222361029 | Gabriel_Irfon | G | Sept. 7, 2023, 6:52 p.m. | OK | Python 3 | TESTS | 40 | 374 | 27340800 | ||
222350992 | 0npata | G | Sept. 7, 2023, 5:26 p.m. | OK | Rust 2021 | TESTS | 40 | 30 | 7372800 |
Back to search problems