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 |
---|---|---|---|---|---|---|
1720 | Codeforces Round 815 (Div. 2) | FINISHED | False | 7200 | 70993499 | Aug. 18, 2022, 1:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 21280 ) | B | Interesting Sum | PROGRAMMING | data structures greedy math |
B'You are given an array a that contains n integers. You can choose any proper subsegment a_l, a_{l + 1}, ldots, a_r of this array, meaning you can choose any two integers 1 <= l <= r <= n , where r - l + 1 < n . We define the beauty of a given subsegment as the value of the following expression: max(a_{1}, a_{2}, ldots, a_{l-1}, a_{r+1}, a_{r+2}, ldots, a_{n}) - min(a_{1}, a_{2}, ldots, a_{l-1}, a_{r+1}, a_{r+2}, ldots, a_{n}) + max(a_{l}, ldots, a_{r}) - min(a_{l}, ldots, a_{r}). Please find the maximum beauty among all proper subsegments. The first line contains one integer t ( 1 <= q t <= q 1000 ) -- the number of test cases. Then follow the descriptions of each test case. The first line of each test case contains a single integer n (4 <= q n <= q 10^5) -- the length of the array. The second line of each test case contains n integers a_1, a_2, ldots, a_n ( 1 <= q a_{i} <= q 10^9 ) -- the elements of the given array. It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each testcase print a single integer -- the maximum beauty of a proper subsegment. In the first test case, the optimal segment is l = 7 , r = 8 . The beauty of this segment equals to (6 - 1) + (5 - 1) = 9 . In the second test case, the optimal segment is l = 2 , r = 4 . The beauty of this segment equals (100 - 2) + (200 - 1) = 297 . '... |
Codeforces Round #815 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
168862253 | ranahamid | B | Aug. 18, 2022, 3:30 p.m. | OK | C# 10 | TESTS | 17 | 62 | 10444800 | ||
168921347 | 6-_-9 | B | Aug. 19, 2022, 5:21 a.m. | OK | C# 10 | TESTS | 18 | 77 | 9830400 | ||
168904606 | Muhammad.exe | B | Aug. 19, 2022, 12:30 a.m. | OK | C# 10 | TESTS | 17 | 124 | 9625600 | ||
168921025 | 6-_-9 | B | Aug. 19, 2022, 5:17 a.m. | OK | C# 10 | TESTS | 18 | 140 | 9728000 | ||
168918761 | 6-_-9 | B | Aug. 19, 2022, 4:47 a.m. | OK | C# 10 | TESTS | 18 | 187 | 9625600 | ||
168921075 | 6-_-9 | B | Aug. 19, 2022, 5:18 a.m. | OK | C# 8 | TESTS | 18 | 186 | 9625600 | ||
168877555 | jessc_wan | B | Aug. 18, 2022, 5:37 p.m. | OK | Clang++17 Diagnostics | TESTS | 17 | 514 | 16281600 | ||
168913952 | RGodz | B | Aug. 19, 2022, 3:28 a.m. | OK | Clang++17 Diagnostics | TESTS | 17 | 592 | 819200 | ||
168908311 | ArthurMorgan1 | B | Aug. 19, 2022, 1:52 a.m. | OK | GNU C11 | TESTS | 17 | 31 | 409600 | ||
168913243 | AOSTL | B | Aug. 19, 2022, 3:18 a.m. | OK | GNU C11 | TESTS | 17 | 46 | 0 | ||
168916392 | samsritha123 | B | Aug. 19, 2022, 4:09 a.m. | OK | GNU C11 | TESTS | 18 | 46 | 409600 | ||
168875177 | kiran_11922 | B | Aug. 18, 2022, 5:19 p.m. | OK | GNU C11 | TESTS | 17 | 46 | 819200 | ||
168915694 | kleincoder | B | Aug. 19, 2022, 3:58 a.m. | OK | GNU C++14 | TESTS | 18 | 31 | 0 | ||
168912242 | OoXiao_QioO | B | Aug. 19, 2022, 3:02 a.m. | OK | GNU C++14 | TESTS | 17 | 31 | 0 | ||
168908754 | Leasier | B | Aug. 19, 2022, 1:59 a.m. | OK | GNU C++14 | TESTS | 17 | 31 | 0 | ||
168914606 | CSonic | B | Aug. 19, 2022, 3:39 a.m. | OK | GNU C++14 | TESTS | 17 | 31 | 409600 | ||
168910940 | YiLinG | B | Aug. 19, 2022, 2:40 a.m. | OK | GNU C++14 | TESTS | 17 | 31 | 409600 | ||
168908498 | efilU | B | Aug. 19, 2022, 1:54 a.m. | OK | GNU C++14 | TESTS | 17 | 31 | 409600 | ||
168923646 | JZH123 | B | Aug. 19, 2022, 5:48 a.m. | OK | GNU C++14 | TESTS | 18 | 31 | 409600 | ||
168917558 | rqoi031 | B | Aug. 19, 2022, 4:28 a.m. | OK | GNU C++14 | TESTS | 18 | 31 | 409600 | ||
168916774 | rantong | B | Aug. 19, 2022, 4:15 a.m. | OK | GNU C++14 | TESTS | 18 | 31 | 409600 | ||
168914727 | CSonic | B | Aug. 19, 2022, 3:41 a.m. | OK | GNU C++14 | TESTS | 17 | 31 | 409600 | ||
168883242 | Asoul_XiangWan | B | Aug. 18, 2022, 6:24 p.m. | OK | GNU C++17 | TESTS | 17 | 30 | 409600 | ||
168892757 | Ravsteel | B | Aug. 18, 2022, 8:09 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 0 | ||
168891748 | codenarocode | B | Aug. 18, 2022, 7:56 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168888617 | Tenjin | B | Aug. 18, 2022, 7:20 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168887593 | Garvit_2013 | B | Aug. 18, 2022, 7:09 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168882408 | SubhajeetLahiri | B | Aug. 18, 2022, 6:16 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168902574 | tuananh238 | B | Aug. 18, 2022, 11:36 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168923046 | hrsh_codr | B | Aug. 19, 2022, 5:41 a.m. | OK | GNU C++17 | TESTS | 18 | 31 | 409600 | ||
168902333 | Abdelaleem | B | Aug. 18, 2022, 11:29 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168898518 | Amr_Elkhatieb | B | Aug. 18, 2022, 9:48 p.m. | OK | GNU C++17 | TESTS | 17 | 31 | 409600 | ||
168902306 | RetsaZC19 | B | Aug. 18, 2022, 11:28 p.m. | OK | GNU C++17 (64) | TESTS | 17 | 15 | 409600 | ||
168904442 | ExplodingKonjac | B | Aug. 19, 2022, 12:26 a.m. | OK | GNU C++17 (64) | TESTS | 17 | 30 | 9216000 | ||
168920236 | Bungmint | B | Aug. 19, 2022, 5:07 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 31 | 409600 | ||
168924370 | AnuMax | B | Aug. 19, 2022, 5:56 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 31 | 409600 | ||
168922002 | torisasami | B | Aug. 19, 2022, 5:30 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 31 | 409600 | ||
168921482 | OTTFF | B | Aug. 19, 2022, 5:23 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 31 | 409600 | ||
168917166 | -wicton- | B | Aug. 19, 2022, 4:22 a.m. | OK | GNU C++17 (64) | TESTS | 18 | 31 | 409600 | ||
168911613 | Kellyz | B | Aug. 19, 2022, 2:51 a.m. | OK | GNU C++17 (64) | TESTS | 17 | 31 | 409600 | ||
168909282 | Ricarpy_ | B | Aug. 19, 2022, 2:09 a.m. | OK | GNU C++17 (64) | TESTS | 17 | 31 | 409600 | ||
168908968 | Sakib62 | B | Aug. 19, 2022, 2:03 a.m. | OK | GNU C++17 (64) | TESTS | 17 | 31 | 409600 | ||
168868240 | Basbousa | B | Aug. 18, 2022, 4:37 p.m. | OK | GNU C++20 (64) | TESTS | 17 | 15 | 409600 | ||
168912868 | Sparr0w_2022 | B | Aug. 19, 2022, 3:13 a.m. | OK | GNU C++20 (64) | TESTS | 17 | 15 | 409600 | ||
168904481 | Miki0 | B | Aug. 19, 2022, 12:27 a.m. | OK | GNU C++20 (64) | TESTS | 17 | 15 | 409600 | ||
168860250 | coolkiller | B | Aug. 18, 2022, 3:25 p.m. | OK | GNU C++20 (64) | TESTS | 17 | 15 | 819200 | ||
168910440 | Oyasuminasai | B | Aug. 19, 2022, 2:31 a.m. | OK | GNU C++20 (64) | TESTS | 17 | 15 | 819200 | ||
168883791 | Unknown2552 | B | Aug. 18, 2022, 6:29 p.m. | OK | GNU C++20 (64) | TESTS | 17 | 30 | 409600 | ||
168868479 | Sleeping_Crow | B | Aug. 18, 2022, 4:38 p.m. | OK | GNU C++20 (64) | TESTS | 17 | 30 | 409600 | ||
168888220 | Shofiqur | B | Aug. 18, 2022, 7:16 p.m. | OK | GNU C++20 (64) | TESTS | 17 | 30 | 409600 | ||
168922659 | Dog_food_is_me fuxianyang | B | Aug. 19, 2022, 5:37 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 30 | 819200 | ||
168922765 | ro27 | B | Aug. 19, 2022, 5:38 a.m. | OK | GNU C++20 (64) | TESTS | 18 | 30 | 819200 | ||
168868183 | koqo | B | Aug. 18, 2022, 4:37 p.m. | OK | Go | TESTS | 17 | 93 | 1638400 | ||
168874795 | _mza | B | Aug. 18, 2022, 5:16 p.m. | OK | Java 11 | TESTS | 17 | 171 | 0 | ||
168923355 | Harshit-Jain | B | Aug. 19, 2022, 5:45 a.m. | OK | Java 11 | TESTS | 18 | 187 | 0 | ||
168920842 | Shady_X | B | Aug. 19, 2022, 5:15 a.m. | OK | Java 11 | TESTS | 18 | 187 | 0 | ||
168913284 | dyxdxy | B | Aug. 19, 2022, 3:19 a.m. | OK | Java 11 | TESTS | 17 | 187 | 0 | ||
168904230 | satyaa_78 | B | Aug. 19, 2022, 12:20 a.m. | OK | Java 11 | TESTS | 17 | 187 | 0 | ||
168901902 | dunkingdonuts | B | Aug. 18, 2022, 11:16 p.m. | OK | Java 11 | TESTS | 17 | 187 | 0 | ||
168871885 | TCchen | B | Aug. 18, 2022, 4:56 p.m. | OK | Java 11 | TESTS | 17 | 187 | 0 | ||
168892519 | brstplayer | B | Aug. 18, 2022, 8:05 p.m. | OK | Java 11 | TESTS | 17 | 202 | 0 | ||
168871914 | princeayush04 | B | Aug. 18, 2022, 4:56 p.m. | OK | Java 11 | TESTS | 17 | 202 | 0 | ||
168873675 | subham_twp | B | Aug. 18, 2022, 5:08 p.m. | OK | Java 11 | TESTS | 17 | 217 | 0 | ||
168877461 | burning_summer | B | Aug. 18, 2022, 5:36 p.m. | OK | Java 17 | TESTS | 17 | 202 | 409600 | ||
168912579 | Mamimi | B | Aug. 19, 2022, 3:08 a.m. | OK | Java 17 | TESTS | 17 | 202 | 512000 | ||
168886122 | CrinklyGolem | B | Aug. 18, 2022, 6:53 p.m. | OK | Java 17 | TESTS | 17 | 218 | 716800 | ||
168874647 | tush_17 | B | Aug. 18, 2022, 5:15 p.m. | OK | Java 17 | TESTS | 17 | 233 | 512000 | ||
168874083 | tush_17 | B | Aug. 18, 2022, 5:11 p.m. | OK | Java 17 | TESTS | 17 | 233 | 614400 | ||
168872940 | souravc492 | B | Aug. 18, 2022, 5:03 p.m. | OK | Java 17 | TESTS | 17 | 233 | 3276800 | ||
168899720 | matzhao | B | Aug. 18, 2022, 10:18 p.m. | OK | Java 17 | TESTS | 17 | 249 | 819200 | ||
168911779 | lrczuiwudi666 | B | Aug. 19, 2022, 2:54 a.m. | OK | Java 17 | TESTS | 17 | 249 | 8192000 | ||
168869723 | ac9117033 | B | Aug. 18, 2022, 4:43 p.m. | OK | Java 17 | TESTS | 17 | 265 | 3891200 | ||
168873435 | souravc492 | B | Aug. 18, 2022, 5:06 p.m. | OK | Java 17 | TESTS | 17 | 374 | 1228800 | ||
168910542 | frey4 | B | Aug. 19, 2022, 2:32 a.m. | OK | Java 8 | TESTS | 17 | 124 | 0 | ||
168909306 | ikillmyself | B | Aug. 19, 2022, 2:10 a.m. | OK | Java 8 | TESTS | 17 | 124 | 0 | ||
168901241 | RahulAhuja2901 | B | Aug. 18, 2022, 10:57 p.m. | OK | Java 8 | TESTS | 17 | 124 | 0 | ||
168868258 | leonlian | B | Aug. 18, 2022, 4:37 p.m. | OK | Java 8 | TESTS | 17 | 124 | 0 | ||
168920962 | waynebruce1704 | B | Aug. 19, 2022, 5:17 a.m. | OK | Java 8 | TESTS | 18 | 124 | 1843200 | ||
168901890 | Diaa12360 | B | Aug. 18, 2022, 11:15 p.m. | OK | Java 8 | TESTS | 17 | 124 | 1843200 | ||
168898747 | YO07 | B | Aug. 18, 2022, 9:54 p.m. | OK | Java 8 | TESTS | 17 | 124 | 1843200 | ||
168874378 | PavneetSingh | B | Aug. 18, 2022, 5:13 p.m. | OK | Java 8 | TESTS | 17 | 124 | 1843200 | ||
168898719 | PavneetSingh | B | Aug. 18, 2022, 9:54 p.m. | OK | Java 8 | TESTS | 17 | 124 | 2252800 | ||
168898896 | PavneetSingh | B | Aug. 18, 2022, 9:58 p.m. | OK | Java 8 | TESTS | 17 | 139 | 0 | ||
168861745 | WildTan | B | Aug. 18, 2022, 3:28 p.m. | OK | Kotlin 1.5 | TESTS | 17 | 421 | 0 | ||
168862465 | kotrin | B | Aug. 18, 2022, 3:30 p.m. | OK | Kotlin 1.6 | TESTS | 17 | 296 | 5017600 | ||
168873303 | pavelk108 | B | Aug. 18, 2022, 5:05 p.m. | OK | Kotlin 1.6 | TESTS | 17 | 343 | 0 | ||
168877822 | Bu1izhnik | B | Aug. 18, 2022, 5:39 p.m. | OK | MS C++ 2017 | TESTS | 17 | 93 | 409600 | ||
168877909 | cptahahab | B | Aug. 18, 2022, 5:39 p.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 0 | ||
168908176 | mark77 | B | Aug. 19, 2022, 1:49 a.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 409600 | ||
168905632 | Agateth | B | Aug. 19, 2022, 12:55 a.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 409600 | ||
168880930 | PyDi_MEHT | B | Aug. 18, 2022, 6:03 p.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 409600 | ||
168879993 | abdoshaisha | B | Aug. 18, 2022, 5:55 p.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 512000 | ||
168885210 | khrystyna_dol | B | Aug. 18, 2022, 6:43 p.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 819200 | ||
168869615 | cchung | B | Aug. 18, 2022, 4:43 p.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 819200 | ||
168881121 | Tan2K | B | Aug. 18, 2022, 6:05 p.m. | OK | MS C++ 2017 | TESTS | 17 | 109 | 2355200 | ||
168924094 | Gex777 | B | Aug. 19, 2022, 5:53 a.m. | OK | MS C++ 2017 | TESTS | 18 | 124 | 409600 | ||
168859839 | wojciechkomor | B | Aug. 18, 2022, 3:24 p.m. | OK | Node.js | TESTS | 17 | 139 | 13209600 | ||
168894970 | chrisc | B | Aug. 18, 2022, 8:42 p.m. | OK | Node.js | TESTS | 17 | 140 | 6860800 | ||
168873338 | 1_2_3_4_5_9 | B | Aug. 18, 2022, 5:05 p.m. | OK | PyPy 2 | TESTS | 17 | 186 | 14643200 | ||
168874106 | abineth | B | Aug. 18, 2022, 5:11 p.m. | OK | PyPy 3 | TESTS | 17 | 171 | 11059200 | ||
168899829 | pushsin089 | B | Aug. 18, 2022, 10:20 p.m. | OK | PyPy 3 | TESTS | 17 | 217 | 11161600 | ||
168879751 | binilj04 | B | Aug. 18, 2022, 5:53 p.m. | OK | PyPy 3 | TESTS | 17 | 218 | 10956800 | ||
168876575 | MohamedHamed123 | B | Aug. 18, 2022, 5:29 p.m. | OK | PyPy 3 | TESTS | 17 | 218 | 11571200 | ||
168877373 | depressed_UG | B | Aug. 18, 2022, 5:35 p.m. | OK | PyPy 3 | TESTS | 17 | 218 | 13107200 | ||
168885659 | yashsarda2002 | B | Aug. 18, 2022, 6:48 p.m. | OK | PyPy 3 | TESTS | 17 | 233 | 10956800 | ||
168913929 | rajat_7887 | B | Aug. 19, 2022, 3:28 a.m. | OK | PyPy 3 | TESTS | 17 | 233 | 11161600 | ||
168873805 | plainwhiteyoghurt | B | Aug. 18, 2022, 5:09 p.m. | OK | PyPy 3 | TESTS | 17 | 264 | 10854400 | ||
168864261 | L4T3 | B | Aug. 18, 2022, 3:34 p.m. | OK | PyPy 3 | TESTS | 17 | 280 | 10956800 | ||
168899912 | Zeyad_mohamed313 | B | Aug. 18, 2022, 10:22 p.m. | OK | PyPy 3 | TESTS | 17 | 280 | 11161600 | ||
168871138 | gesuta | B | Aug. 18, 2022, 4:51 p.m. | OK | PyPy 3-64 | TESTS | 17 | 93 | 13516800 | ||
168899159 | ASawe2.6Main | B | Aug. 18, 2022, 10:04 p.m. | OK | PyPy 3-64 | TESTS | 17 | 93 | 13824000 | ||
168916282 | Youarenotgood | B | Aug. 19, 2022, 4:08 a.m. | OK | PyPy 3-64 | TESTS | 18 | 93 | 13926400 | ||
168911021 | InariInDream | B | Aug. 19, 2022, 2:41 a.m. | OK | PyPy 3-64 | TESTS | 17 | 93 | 16486400 | ||
168892982 | KanishkGoel | B | Aug. 18, 2022, 8:12 p.m. | OK | PyPy 3-64 | TESTS | 17 | 93 | 16793600 | ||
168868386 | DrMrogon | B | Aug. 18, 2022, 4:38 p.m. | OK | PyPy 3-64 | TESTS | 17 | 93 | 17305600 | ||
168871007 | SangeetaSingh | B | Aug. 18, 2022, 4:50 p.m. | OK | PyPy 3-64 | TESTS | 17 | 108 | 14643200 | ||
168902618 | voicon | B | Aug. 18, 2022, 11:38 p.m. | OK | PyPy 3-64 | TESTS | 17 | 109 | 13824000 | ||
168868332 | conqueror_of_titia | B | Aug. 18, 2022, 4:37 p.m. | OK | PyPy 3-64 | TESTS | 17 | 109 | 14028800 | ||
168871131 | shubh1815 | B | Aug. 18, 2022, 4:51 p.m. | OK | PyPy 3-64 | TESTS | 17 | 109 | 15564800 | ||
168883926 | Homeo | B | Aug. 18, 2022, 6:30 p.m. | OK | Python 3 | TESTS | 17 | 78 | 8806400 | ||
168882372 | Homeo | B | Aug. 18, 2022, 6:16 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8704000 | ||
168922177 | khonshu_99 | B | Aug. 19, 2022, 5:32 a.m. | OK | Python 3 | TESTS | 18 | 93 | 8806400 | ||
168905917 | sshinohs | B | Aug. 19, 2022, 1:02 a.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168901942 | liuaaa | B | Aug. 18, 2022, 11:17 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168895260 | aniket.sur681 | B | Aug. 18, 2022, 8:46 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168888285 | rishav__01 | B | Aug. 18, 2022, 7:17 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168886660 | amulyakr | B | Aug. 18, 2022, 6:59 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168885234 | .undefined. | B | Aug. 18, 2022, 6:43 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168882777 | vector_code7 | B | Aug. 18, 2022, 6:19 p.m. | OK | Python 3 | TESTS | 17 | 93 | 8806400 | ||
168900634 | kena0ki | B | Aug. 18, 2022, 10:40 p.m. | OK | Rust 2021 | TESTS | 17 | 15 | 4198400 | ||
168874529 | LittleFall | B | Aug. 18, 2022, 5:14 p.m. | OK | Rust 2021 | TESTS | 17 | 15 | 4198400 | ||
168873341 | Ryuk10 | B | Aug. 18, 2022, 5:05 p.m. | OK | Rust 2021 | TESTS | 17 | 31 | 9318400 |
Back to search problems