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 |
---|---|---|---|---|---|---|
1991 | Pinely Round 4 (Div. 1 + Div. 2) | FINISHED | False | 10800 | 9645899 | July 28, 2024, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 21805 ) | A | Maximize the Last Element | PROGRAMMING | greedy implementation |
B'You are given an array a of n integers, where n is odd. In one operation, you will remove two adjacent elements from the array a , and then concatenate the remaining parts of the array. For example, given the array [4,7,4,2,9] , we can obtain the arrays [4,2,9] and [4,7,9] by the operations [ underline{4,7}, 4,2,9] to [4,2,9] and [4,7, underline{4,2},9] to [4,7,9] respectively. However, we cannot obtain the array [7,2,9] as it requires deleting non-adjacent elements [ underline{4},7, underline{4},2,9] . You will repeatedly perform this operation until exactly one element remains in a . Find the maximum possible value of the remaining element in a . Each test contains multiple test cases. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The description of test cases follows. The first line of each test case contains a single integer n ( 1 <= n <= 99 ; n is odd) -- 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 <= 100 ) -- the elements of the array a . Note that there is no bound on the sum of n over all test cases. For each test case, output a single integer -- the maximum possible value of the remaining element in a . In the first test case, the array a is [6] . Since there is only one element, no operations are needed. The maximum possible value of the remaining element is 6 . In the second test case, the array a is [1, 3, 2] . We can remove the first two elements [ underline{1, 3}, 2] to [2] , or remove the last two elements [1, underline{3, 2}] to [1] . Therefore, the maximum possible value of the remaining element is 2 . In the third test case, the array a is [4, 7, 4, 2, 9] . One way to maximize the remaining element is [4, underline{7'... |
Video Tutorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
273272600 | A1ternate | A | July 29, 2024, 3:58 a.m. | OK | C# 10 | TESTS | 3 | 93 | 4096000 | ||
273237043 | nemars | A | July 28, 2024, 7:10 p.m. | OK | C# 10 | TESTS | 3 | 109 | 2662400 | ||
273279903 | wubaiting2020 | A | July 29, 2024, 5:24 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273279835 | Vedanttttt_Pandey | A | July 29, 2024, 5:23 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273279367 | codewithprakhar | A | July 29, 2024, 5:19 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273276933 | wycgy | A | July 29, 2024, 4:50 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273274882 | COI | A | July 29, 2024, 4:26 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273270625 | lyyq3cn2 | A | July 29, 2024, 3:35 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273269365 | Trubiacy | A | July 29, 2024, 3:20 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273269112 | DBQDong | A | July 29, 2024, 3:17 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273266629 | vikas82gowda | A | July 29, 2024, 2:50 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273280744 | shrikantacharya13 | A | July 29, 2024, 5:34 a.m. | OK | C++14 (GCC 6-32) | TESTS | 3 | 46 | 0 | ||
273279356 | daksh584 | A | July 29, 2024, 5:19 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 30 | 0 | ||
273259384 | kumar.tanay | A | July 29, 2024, 1:22 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273279178 | mostafasazid | A | July 29, 2024, 5:16 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273274932 | Eshan_12 | A | July 29, 2024, 4:27 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273271190 | djs100201 | A | July 29, 2024, 3:42 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273267406 | DIP_BALDHA1132 | A | July 29, 2024, 2:59 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273264170 | rakib2624 | A | July 29, 2024, 2:21 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273262283 | zken7 | A | July 29, 2024, 2 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273260580 | saihemanth9019 | A | July 29, 2024, 1:37 a.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273235411 | Mostafa_Abdelghafar21 | A | July 28, 2024, 6:59 p.m. | OK | C++17 (GCC 7-32) | TESTS | 3 | 31 | 0 | ||
273275509 | shiv_abhi_ngr | A | July 29, 2024, 4:34 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 30 | 0 | ||
273250771 | NJX4122 | A | July 28, 2024, 10:24 p.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 30 | 0 | ||
273263316 | rockqte | A | July 29, 2024, 2:11 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273283518 | Serendipity__ | A | July 29, 2024, 6:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273283499 | Zeaqle | A | July 29, 2024, 6:01 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273279869 | sohailkazi | A | July 29, 2024, 5:24 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273274472 | makaderbrac | A | July 29, 2024, 4:21 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273273898 | hnust_xiaoqi | A | July 29, 2024, 4:14 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273273421 | Shubhamyadav23516 | A | July 29, 2024, 4:08 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273264189 | aashraymahajan374 | A | July 29, 2024, 2:21 a.m. | OK | C++20 (GCC 13-64) | TESTS | 3 | 31 | 0 | ||
273257623 | bluemegane | A | July 29, 2024, 12:56 a.m. | OK | C# 8 | TESTS | 3 | 108 | 2867200 | ||
273269637 | _paint_the_town_red | A | July 29, 2024, 3:23 a.m. | OK | GNU C11 | TESTS | 3 | 31 | 0 | ||
273238931 | gargi23 | A | July 28, 2024, 7:26 p.m. | OK | GNU C11 | TESTS | 3 | 31 | 102400 | ||
273272763 | fanfly | A | July 29, 2024, 4 a.m. | OK | GNU C11 | TESTS | 3 | 46 | 0 | ||
273272111 | fanfly | A | July 29, 2024, 3:53 a.m. | OK | GNU C11 | TESTS | 3 | 46 | 102400 | ||
273282605 | SMuhammed | A | July 29, 2024, 5:53 a.m. | OK | GNU C11 | TESTS | 3 | 61 | 102400 | ||
273247061 | ---hariharan--- | A | July 28, 2024, 9:18 p.m. | OK | GNU C11 | TESTS | 3 | 61 | 102400 | ||
273244338 | bjeljik | A | July 28, 2024, 8:37 p.m. | OK | GNU C11 | TESTS | 3 | 61 | 102400 | ||
273239606 | Bartwal | A | July 28, 2024, 7:33 p.m. | OK | GNU C11 | TESTS | 3 | 62 | 102400 | ||
273266931 | NoobCoderWT | A | July 29, 2024, 2:53 a.m. | OK | GNU C11 | TESTS | 3 | 77 | 0 | ||
273240343 | kylianm7 | A | July 28, 2024, 7:41 p.m. | OK | Go | TESTS | 3 | 249 | 4198400 | ||
273246688 | bhataktaBhai | A | July 28, 2024, 9:12 p.m. | OK | Haskell | TESTS | 3 | 155 | 0 | ||
273273570 | Multi-Thread | A | July 29, 2024, 4:10 a.m. | OK | Java 21 | TESTS | 3 | 156 | 204800 | ||
273246287 | Sarthak_Kharka | A | July 28, 2024, 9:06 p.m. | OK | Java 21 | TESTS | 3 | 186 | 0 | ||
273250461 | shashank_om | A | July 28, 2024, 10:18 p.m. | OK | Java 21 | TESTS | 3 | 187 | 307200 | ||
273279455 | vinay_panwar | A | July 29, 2024, 5:19 a.m. | OK | Java 21 | TESTS | 3 | 202 | 614400 | ||
273245450 | dzhi | A | July 28, 2024, 8:55 p.m. | OK | Java 21 | TESTS | 3 | 218 | 307200 | ||
273272286 | chinatest | A | July 29, 2024, 3:55 a.m. | OK | Java 21 | TESTS | 3 | 233 | 614400 | ||
273238535 | guptadhairya167 | A | July 28, 2024, 7:22 p.m. | OK | Java 21 | TESTS | 3 | 234 | 409600 | ||
273261415 | bobib | A | July 29, 2024, 1:49 a.m. | OK | Java 21 | TESTS | 3 | 249 | 0 | ||
273255805 | chengzijun_de_xiatian | A | July 29, 2024, 12:19 a.m. | OK | Java 21 | TESTS | 3 | 280 | 512000 | ||
273238296 | amansingh3252 | A | July 28, 2024, 7:20 p.m. | OK | Java 21 | TESTS | 3 | 296 | 307200 | ||
273280967 | skyblu-ltng | A | July 29, 2024, 5:36 a.m. | OK | Java 8 | TESTS | 3 | 124 | 0 | ||
273243435 | shashankp10 | A | July 28, 2024, 8:21 p.m. | OK | Java 8 | TESTS | 3 | 140 | 0 | ||
273267248 | om172 | A | July 29, 2024, 2:57 a.m. | OK | Java 8 | TESTS | 3 | 140 | 0 | ||
273241054 | CipherSphinx_Raj | A | July 28, 2024, 7:49 p.m. | OK | Java 8 | TESTS | 3 | 140 | 39014400 | ||
273238519 | nithikeshbekkary | A | July 28, 2024, 7:22 p.m. | OK | Java 8 | TESTS | 3 | 233 | 0 | ||
273240901 | Mahf | A | July 28, 2024, 7:48 p.m. | OK | Java 8 | TESTS | 3 | 233 | 0 | ||
273240313 | nicolarabeee12 | A | July 28, 2024, 7:41 p.m. | OK | Java 8 | TESTS | 3 | 233 | 0 | ||
273236190 | sharmavinayak85000 | A | July 28, 2024, 7:03 p.m. | OK | Java 8 | TESTS | 3 | 233 | 0 | ||
273252232 | nis1234 | A | July 28, 2024, 10:54 p.m. | OK | Java 8 | TESTS | 3 | 234 | 0 | ||
273283669 | Kaikondar | A | July 29, 2024, 6:03 a.m. | OK | Java 8 | TESTS | 3 | 234 | 0 | ||
273268364 | HXiaoXvan | A | July 29, 2024, 3:09 a.m. | OK | Mono C# | TESTS | 3 | 93 | 2867200 | ||
273243663 | devpascal | A | July 28, 2024, 8:25 p.m. | OK | Node.js | TESTS | 3 | 108 | 2150400 | ||
273247864 | WalrusRamen21 | A | July 28, 2024, 9:30 p.m. | OK | PyPy 3 | TESTS | 3 | 108 | 2969600 | ||
273247750 | WalrusRamen21 | A | July 28, 2024, 9:28 p.m. | OK | PyPy 3 | TESTS | 3 | 155 | 6041600 | ||
273283525 | AnirudhS1704 | A | July 29, 2024, 6:01 a.m. | OK | PyPy 3 | TESTS | 3 | 171 | 6041600 | ||
273256214 | bpdolson | A | July 29, 2024, 12:28 a.m. | OK | PyPy 3 | TESTS | 3 | 171 | 6144000 | ||
273238175 | Eric_Wang0007 | A | July 28, 2024, 7:19 p.m. | OK | PyPy 3 | TESTS | 3 | 187 | 5632000 | ||
273272635 | yatohiyo | A | July 29, 2024, 3:59 a.m. | OK | PyPy 3 | TESTS | 3 | 202 | 5017600 | ||
273241605 | MTA9402 | A | July 28, 2024, 7:55 p.m. | OK | PyPy 3 | TESTS | 3 | 203 | 6246400 | ||
273237733 | iib2022029 | A | July 28, 2024, 7:15 p.m. | OK | PyPy 3 | TESTS | 3 | 249 | 7577600 | ||
273265299 | nealzane | A | July 29, 2024, 2:34 a.m. | OK | PyPy 3 | TESTS | 3 | 280 | 5120000 | ||
273273354 | gardengnome | A | July 29, 2024, 4:07 a.m. | OK | PyPy 3-64 | TESTS | 3 | 92 | 2048000 | ||
273275798 | bokuto_alright | A | July 29, 2024, 4:37 a.m. | OK | PyPy 3-64 | TESTS | 3 | 93 | 2252800 | ||
273243781 | singh.eureka | A | July 28, 2024, 8:27 p.m. | OK | PyPy 3-64 | TESTS | 3 | 93 | 2355200 | ||
273242740 | Monocrap | A | July 28, 2024, 8:10 p.m. | OK | PyPy 3-64 | TESTS | 3 | 93 | 2355200 | ||
273276471 | mikeac | A | July 29, 2024, 4:45 a.m. | OK | PyPy 3-64 | TESTS | 3 | 93 | 3174400 | ||
273252579 | elnazar | A | July 28, 2024, 11:02 p.m. | OK | PyPy 3-64 | TESTS | 3 | 93 | 3174400 | ||
273251402 | dcdj | A | July 28, 2024, 10:37 p.m. | OK | PyPy 3-64 | TESTS | 3 | 93 | 3481600 | ||
273270659 | Newbie_ | A | July 29, 2024, 3:36 a.m. | OK | PyPy 3-64 | TESTS | 3 | 108 | 2355200 | ||
273261473 | rickdoeswho | A | July 29, 2024, 1:50 a.m. | OK | PyPy 3-64 | TESTS | 3 | 109 | 3276800 | ||
273265186 | hirose2020 | A | July 29, 2024, 2:33 a.m. | OK | PyPy 3-64 | TESTS | 3 | 109 | 3276800 | ||
273278843 | 2210030020m | A | July 29, 2024, 5:12 a.m. | OK | Python 3 | TESTS | 3 | 61 | 0 | ||
273282449 | Mr_Robot_-_- | A | July 29, 2024, 5:51 a.m. | OK | Python 3 | TESTS | 3 | 62 | 0 | ||
273240515 | sarthakj314 | A | July 28, 2024, 7:43 p.m. | OK | Python 3 | TESTS | 3 | 62 | 0 | ||
273237010 | MSBrainiac | A | July 28, 2024, 7:09 p.m. | OK | Python 3 | TESTS | 3 | 62 | 0 | ||
273279815 | amanojs1980 | A | July 29, 2024, 5:23 a.m. | OK | Python 3 | TESTS | 3 | 77 | 0 | ||
273274979 | ryanimal | A | July 29, 2024, 4:27 a.m. | OK | Python 3 | TESTS | 3 | 77 | 0 | ||
273272468 | 3juhwan | A | July 29, 2024, 3:57 a.m. | OK | Python 3 | TESTS | 3 | 77 | 0 | ||
273261360 | jai_gurudev | A | July 29, 2024, 1:49 a.m. | OK | Python 3 | TESTS | 3 | 77 | 0 | ||
273244417 | RoverC | A | July 28, 2024, 8:39 p.m. | OK | Python 3 | TESTS | 3 | 77 | 0 | ||
273238997 | nathanmathewv | A | July 28, 2024, 7:27 p.m. | OK | Python 3 | TESTS | 3 | 77 | 0 | ||
273247235 | Vikala | A | July 28, 2024, 9:21 p.m. | OK | Rust 2021 | TESTS | 3 | 61 | 0 |
Back to search problems