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 |
---|---|---|---|---|---|---|
1787 | TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!) | FINISHED | False | 10800 | 62263463 | Jan. 29, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 7299 ) | C | Remove the Bracket | PROGRAMMING | dp greedy math |
B'RSJ has a sequence a of n integers a_1,a_2, ldots, a_n and an integer s . For each of a_2,a_3, ldots, a_{n-1} , he chose a pair of non-negative integers x_i and y_i such that x_i+y_i=a_i and (x_i-s) cdot (y_i-s) geq 0 . Now he is interested in the value F = a_1 cdot x_2+y_2 cdot x_3+y_3 cdot x_4 + ldots + y_{n - 2} cdot x_{n-1}+y_{n-1} cdot a_n. Please help him find the minimum possible value F he can get by choosing x_i and y_i optimally. It can be shown that there is always at least one valid way to choose them. Each test contains multiple test cases. The first line contains an integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The first line of each test case contains two integers n , s ( 3 <= n <= 2 cdot 10^5 ; 0 <= s <= 2 cdot 10^5 ). The second line contains n integers a_1,a_2, ldots,a_n ( 0 <= a_i <= 2 cdot 10^5 ). It is guaranteed that the sum of n does not exceed 2 cdot 10^5 . For each test case, print the minimum possible value of F . In the first test case, 2 cdot 0+0 cdot 1+0 cdot 3+0 cdot 4 = 0 . In the second test case, 5 cdot 1+2 cdot 2+2 cdot 2+1 cdot 5 = 18 . '... |
TypeDB Forces 2023 (Div. 1 + Div. 2, Rated, Prizes!) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
191157454 | NenadDapic | C | Jan. 29, 2023, 5:07 p.m. | OK | FPC | TESTS | 24 | 109 | 11264000 | ||
191144484 | gultai4ukr | C | Jan. 29, 2023, 4:08 p.m. | OK | GNU C++14 | TESTS | 24 | 62 | 819200 | ||
191196420 | KirimaSharo | C | Jan. 30, 2023, 2:24 a.m. | OK | GNU C++14 | TESTS | 24 | 62 | 1638400 | ||
191202928 | hexagonwarrior | C | Jan. 30, 2023, 4:15 a.m. | OK | GNU C++14 | TESTS | 24 | 62 | 2457600 | ||
191160949 | Tahsin13 | C | Jan. 29, 2023, 5:24 p.m. | OK | GNU C++14 | TESTS | 24 | 62 | 3993600 | ||
191142818 | harshbutani01 | C | Jan. 29, 2023, 4:02 p.m. | OK | GNU C++14 | TESTS | 24 | 62 | 4812800 | ||
191192852 | zdc123456 | C | Jan. 30, 2023, 1:08 a.m. | OK | GNU C++14 | TESTS | 24 | 62 | 5632000 | ||
191192094 | KING_OF_TURTLE | C | Jan. 30, 2023, 12:49 a.m. | OK | GNU C++14 | TESTS | 24 | 62 | 5632000 | ||
191159681 | Akana1366 | C | Jan. 29, 2023, 5:17 p.m. | OK | GNU C++14 | TESTS | 24 | 62 | 5632000 | ||
191198613 | learner_RR | C | Jan. 30, 2023, 3:05 a.m. | OK | GNU C++14 | TESTS | 24 | 62 | 6451200 | ||
191154612 | ttt1anyu | C | Jan. 29, 2023, 4:53 p.m. | OK | GNU C++14 | TESTS | 24 | 62 | 7270400 | ||
191152936 | The-Winner | C | Jan. 29, 2023, 4:45 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 0 | ||
191160441 | fxfxxxfxx | C | Jan. 29, 2023, 5:21 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 819200 | ||
191159340 | orangecalculator | C | Jan. 29, 2023, 5:16 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 819200 | ||
191156532 | HaroldVemeno | C | Jan. 29, 2023, 5:02 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 819200 | ||
191144704 | antonis.white | C | Jan. 29, 2023, 4:09 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 819200 | ||
191171440 | daria.roganova71 | C | Jan. 29, 2023, 6:57 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 1638400 | ||
191187612 | Luca | C | Jan. 29, 2023, 10:40 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 3993600 | ||
191151330 | machhra | C | Jan. 29, 2023, 4:38 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 3993600 | ||
191201649 | __Quang__ | C | Jan. 30, 2023, 3:54 a.m. | OK | GNU C++17 | TESTS | 24 | 62 | 4812800 | ||
191179372 | Mreza5760 | C | Jan. 29, 2023, 8:23 p.m. | OK | GNU C++17 | TESTS | 24 | 62 | 4812800 | ||
191144984 | FillBred | C | Jan. 29, 2023, 4:10 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 30 | 7680000 | ||
191148671 | Askiatic | C | Jan. 29, 2023, 4:26 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 31 | 42086400 | ||
191143248 | antguz | C | Jan. 29, 2023, 4:03 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 2457600 | ||
191184467 | enslaved | C | Jan. 29, 2023, 9:39 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 3993600 | ||
191187566 | AGG | C | Jan. 29, 2023, 10:39 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 4812800 | ||
191147310 | CurryWOE | C | Jan. 29, 2023, 4:20 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 4812800 | ||
191142205 | jcccc | C | Jan. 29, 2023, 3:59 p.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 4812800 | ||
191208182 | iamone | C | Jan. 30, 2023, 5:42 a.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 5632000 | ||
191205515 | FishAndCat | C | Jan. 30, 2023, 5:02 a.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 5632000 | ||
191197726 | iamone | C | Jan. 30, 2023, 2:50 a.m. | OK | GNU C++17 (64) | TESTS | 24 | 46 | 5632000 | ||
191199379 | _andyli | C | Jan. 30, 2023, 3:17 a.m. | OK | GNU C++20 (64) | TESTS | 24 | 30 | 25907200 | ||
191169985 | achvanov | C | Jan. 29, 2023, 6:46 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 0 | ||
191173158 | luo233 | C | Jan. 29, 2023, 7:13 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 2457600 | ||
191153806 | AaronHe | C | Jan. 29, 2023, 4:49 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 2457600 | ||
191151510 | Mehedi_Hasan_ | C | Jan. 29, 2023, 4:38 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 4812800 | ||
191149513 | SajidZakaria | C | Jan. 29, 2023, 4:29 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 4812800 | ||
191174787 | EgorSav | C | Jan. 29, 2023, 7:29 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 6348800 | ||
191191213 | Baaaraa | C | Jan. 30, 2023, 12:21 a.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 6451200 | ||
191172349 | luo233 | C | Jan. 29, 2023, 7:05 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 7270400 | ||
191189953 | onani | C | Jan. 29, 2023, 11:41 p.m. | OK | GNU C++20 (64) | TESTS | 24 | 31 | 7987200 | ||
191207648 | qiong-14 | C | Jan. 30, 2023, 5:35 a.m. | OK | Go | TESTS | 24 | 124 | 15257600 | ||
191147119 | DarLam | C | Jan. 29, 2023, 4:19 p.m. | OK | Java 11 | TESTS | 24 | 249 | 0 | ||
191202796 | Dinesh_Pandiyan | C | Jan. 30, 2023, 4:12 a.m. | OK | Java 11 | TESTS | 24 | 295 | 28467200 | ||
191155350 | meteoLdrago | C | Jan. 29, 2023, 4:57 p.m. | OK | Java 11 | TESTS | 24 | 342 | 53248000 | ||
191159190 | procrastinate7 | C | Jan. 29, 2023, 5:15 p.m. | OK | Java 11 | TESTS | 24 | 389 | 65945600 | ||
191147036 | vikaschhonkar1 | C | Jan. 29, 2023, 4:18 p.m. | OK | Java 11 | TESTS | 24 | 623 | 7372800 | ||
191161088 | Yousef_Badr | C | Jan. 29, 2023, 5:24 p.m. | OK | Java 17 | TESTS | 24 | 265 | 11776000 | ||
191199969 | HeyHello2 | C | Jan. 30, 2023, 3:26 a.m. | OK | Java 17 | TESTS | 24 | 296 | 17920000 | ||
191146634 | papa_kipari_13 | C | Jan. 29, 2023, 4:17 p.m. | OK | Java 17 | TESTS | 24 | 560 | 7884800 | ||
191170032 | bepablop | C | Jan. 29, 2023, 6:46 p.m. | OK | Java 17 | TESTS | 24 | 561 | 5017600 | ||
191146947 | Rahulraghav358 | C | Jan. 29, 2023, 4:18 p.m. | OK | Java 17 | TESTS | 24 | 561 | 8499200 | ||
191142294 | Anu_Jha | C | Jan. 29, 2023, 4 p.m. | OK | Java 17 | TESTS | 24 | 577 | 19865600 | ||
191175733 | megaspazz | C | Jan. 29, 2023, 7:40 p.m. | OK | Java 8 | TESTS | 24 | 124 | 2764800 | ||
191154306 | megaspazz | C | Jan. 29, 2023, 4:52 p.m. | OK | Java 8 | TESTS | 24 | 124 | 2764800 | ||
191148365 | not_just_rr | C | Jan. 29, 2023, 4:24 p.m. | OK | Java 8 | TESTS | 24 | 186 | 9932800 | ||
191153675 | gtiwari912 | C | Jan. 29, 2023, 4:49 p.m. | OK | Java 8 | TESTS | 24 | 187 | 17715200 | ||
191163599 | ZakiKurdya | C | Jan. 29, 2023, 5:34 p.m. | OK | Java 8 | TESTS | 24 | 218 | 14950400 | ||
191170652 | anonxx5 | C | Jan. 29, 2023, 6:50 p.m. | OK | Java 8 | TESTS | 24 | 218 | 18227200 | ||
191161892 | formidablechief_27 | C | Jan. 29, 2023, 5:28 p.m. | OK | Java 8 | TESTS | 24 | 248 | 31334400 | ||
191144820 | Swapniltri | C | Jan. 29, 2023, 4:09 p.m. | OK | Java 8 | TESTS | 24 | 248 | 55193600 | ||
191149525 | GlockGod | C | Jan. 29, 2023, 4:29 p.m. | OK | Java 8 | TESTS | 24 | 249 | 50688000 | ||
191142902 | 12312sa | C | Jan. 29, 2023, 4:02 p.m. | OK | Java 8 | TESTS | 24 | 546 | 17100800 | ||
191208443 | 1434314294 | C | Jan. 30, 2023, 5:46 a.m. | OK | MS C++ 2017 | TESTS | 24 | 109 | 5632000 | ||
191147610 | aadrito | C | Jan. 29, 2023, 4:21 p.m. | OK | MS C++ 2017 | TESTS | 24 | 187 | 8089600 | ||
191142393 | Alexey | C | Jan. 29, 2023, 4 p.m. | OK | MS C++ 2017 | TESTS | 24 | 265 | 15257600 | ||
191142479 | sksshivam007 | C | Jan. 29, 2023, 4 p.m. | OK | PyPy 2 | TESTS | 24 | 733 | 42188800 | ||
191158728 | Greyhound | C | Jan. 29, 2023, 5:13 p.m. | OK | PyPy 3 | TESTS | 24 | 686 | 33894400 | ||
191142456 | BeBeBe66666 | C | Jan. 29, 2023, 4 p.m. | OK | PyPy 3 | TESTS | 24 | 732 | 35840000 | ||
191180335 | bpdolson | C | Jan. 29, 2023, 8:36 p.m. | OK | PyPy 3 | TESTS | 24 | 764 | 17100800 | ||
191162553 | Andy_Huo | C | Jan. 29, 2023, 5:31 p.m. | OK | PyPy 3 | TESTS | 24 | 997 | 41062400 | ||
191146280 | InvalidSyntax | C | Jan. 29, 2023, 4:15 p.m. | OK | PyPy 3-64 | TESTS | 24 | 171 | 20582400 | ||
191190670 | Remineva | C | Jan. 30, 2023, 12:05 a.m. | OK | PyPy 3-64 | TESTS | 24 | 202 | 20889600 | ||
191158054 | r57shell | C | Jan. 29, 2023, 5:10 p.m. | OK | PyPy 3-64 | TESTS | 24 | 217 | 21708800 | ||
191144107 | ossau_guildo | C | Jan. 29, 2023, 4:07 p.m. | OK | PyPy 3-64 | TESTS | 24 | 217 | 33484800 | ||
191177038 | ZrjaK | C | Jan. 29, 2023, 7:54 p.m. | OK | PyPy 3-64 | TESTS | 24 | 218 | 27648000 | ||
191169508 | Th_K | C | Jan. 29, 2023, 6:42 p.m. | OK | PyPy 3-64 | TESTS | 24 | 233 | 27033600 | ||
191163341 | dipakgupta007 | C | Jan. 29, 2023, 5:34 p.m. | OK | PyPy 3-64 | TESTS | 24 | 233 | 32768000 | ||
191157353 | moonpay | C | Jan. 29, 2023, 5:06 p.m. | OK | PyPy 3-64 | TESTS | 24 | 233 | 34304000 | ||
191169151 | TheViking733n | C | Jan. 29, 2023, 6:40 p.m. | OK | PyPy 3-64 | TESTS | 24 | 233 | 38707200 | ||
191193070 | Little_Sheep_Yawn | C | Jan. 30, 2023, 1:13 a.m. | OK | PyPy 3-64 | TESTS | 24 | 248 | 39219200 | ||
191208282 | yobukishore1 | C | Jan. 30, 2023, 5:44 a.m. | OK | Python 3 | TESTS | 24 | 499 | 14233600 | ||
191158848 | priyanshuvaya6 | C | Jan. 29, 2023, 5:13 p.m. | OK | Python 3 | TESTS | 24 | 639 | 29696000 | ||
191163139 | theotherguyasus | C | Jan. 29, 2023, 5:33 p.m. | OK | Python 3 | TESTS | 24 | 654 | 21504000 | ||
191142562 | CoderPratik | C | Jan. 29, 2023, 4:01 p.m. | OK | Python 3 | TESTS | 24 | 732 | 14028800 | ||
191161919 | Malik_Zadah_Irfan | C | Jan. 29, 2023, 5:28 p.m. | OK | Python 3 | TESTS | 24 | 764 | 26214400 | ||
191160728 | neeshumaini55 | C | Jan. 29, 2023, 5:23 p.m. | OK | Python 3 | TESTS | 24 | 795 | 29696000 | ||
191175487 | PugachAG | C | Jan. 29, 2023, 7:37 p.m. | OK | Rust 2021 | TESTS | 24 | 46 | 1638400 | ||
191162495 | variance | C | Jan. 29, 2023, 5:31 p.m. | OK | Rust 2021 | TESTS | 24 | 140 | 14131200 |
Back to search problems