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 |
---|---|---|---|---|---|---|
1682 | Codeforces Round 793 (Div. 2) | FINISHED | False | 7200 | 84036263 | May 22, 2022, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 15176 ) | C | LIS or Reverse LIS? | PROGRAMMING | constructive algorithms greedy implementation math |
B"You are given an array a of n positive integers. Let text{LIS}(a) denote the length of longest strictly increasing subsequence of a . For example, We define array a' as the array obtained after reversing the array a i.e. a' = [a_n, a_{n-1}, ldots , a_1] . The beauty of array a is defined as min( text{LIS}(a), text{LIS}(a')) . Your task is to determine the maximum possible beauty of the array a if you can rearrange the array a arbitrarily. The input consists of multiple test cases. The first line contains a single integer t (1 <= q t <= q 10^4) -- the number of test cases. Description of the test cases follows. The first line of each test case contains a single integer n (1 <= q n <= q 2 cdot 10^5) -- the length of array a . 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 array a . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 . For each test case, output a single integer -- the maximum possible beauty of a after rearranging its elements arbitrarily. In the first test case, a = [6, 6, 6] and a' = [6, 6, 6] . text{LIS}(a) = text{LIS}(a') = 1 . Hence the beauty is min(1, 1) = 1 . In the second test case, a can be rearranged to [2, 5, 4, 5, 4, 2] . Then a' = [2, 4, 5, 4, 5, 2] . text{LIS}(a) = text{LIS}(a') = 3 . Hence the beauty is 3 and it can be shown that this is the maximum possible beauty. In the third test case, a can be rearranged to [1, 2, 3, 2] . Then a' = [2, 3, 2, 1] . text{LIS}(a) = 3 , text{LIS}(a') = 2 . Hence the beauty is min(3, 2) = 2 and it can be shown that 2 is the maximum possible beauty. "... |
Codeforces Round #793 (Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
158113403 | FortyFour | C | May 23, 2022, 5:21 a.m. | OK | C# 10 | TESTS | 28 | 124 | 33382400 | ||
158330520 | majer442 | C | May 24, 2022, 6:58 p.m. | OK | C# 8 | TESTS | 28 | 249 | 52838400 | ||
158108909 | ruban | C | May 23, 2022, 4:02 a.m. | OK | FPC | TESTS | 28 | 202 | 77414400 | ||
158132505 | Bobocan | C | May 23, 2022, 10:05 a.m. | OK | GNU C11 | TESTS | 28 | 31 | 6451200 | ||
158132146 | Bobocan | C | May 23, 2022, 10 a.m. | OK | GNU C11 | TESTS | 28 | 46 | 11264000 | ||
158132034 | Bobocan | C | May 23, 2022, 9:58 a.m. | OK | GNU C11 | TESTS | 28 | 46 | 25702400 | ||
158132102 | Bobocan | C | May 23, 2022, 9:59 a.m. | OK | GNU C11 | TESTS | 28 | 61 | 242073600 | ||
158112787 | akshat211103 | C | May 23, 2022, 5:11 a.m. | OK | GNU C11 | TESTS | 28 | 77 | 819200 | ||
158301772 | GTrigger | C | May 24, 2022, 1:23 p.m. | OK | GNU C11 | TESTS | 28 | 78 | 819200 | ||
158109813 | keutoi | C | May 23, 2022, 4:21 a.m. | OK | GNU C11 | TESTS | 28 | 78 | 819200 | ||
158112751 | akshat211103 | C | May 23, 2022, 5:10 a.m. | OK | GNU C11 | TESTS | 28 | 78 | 819200 | ||
158104820 | jiangbowen | C | May 23, 2022, 2:33 a.m. | OK | GNU C++14 | TESTS | 28 | 31 | 2764800 | ||
158254569 | ZhangCW_QwQ | C | May 24, 2022, 1:50 a.m. | OK | GNU C++14 | TESTS | 28 | 46 | 4505600 | ||
158140062 | srijon51 | C | May 23, 2022, 11:50 a.m. | OK | GNU C++14 | TESTS | 28 | 62 | 819200 | ||
158135390 | dengziyue | C | May 23, 2022, 10:49 a.m. | OK | GNU C++14 | TESTS | 28 | 62 | 819200 | ||
158127833 | CYHei_mu | C | May 23, 2022, 8:56 a.m. | OK | GNU C++14 | TESTS | 28 | 62 | 819200 | ||
158123800 | blade_dance | C | May 23, 2022, 7:56 a.m. | OK | GNU C++14 | TESTS | 28 | 62 | 3993600 | ||
158134572 | le0n | C | May 23, 2022, 10:37 a.m. | OK | GNU C++14 | TESTS | 28 | 77 | 819200 | ||
158110073 | albertbow | C | May 23, 2022, 4:26 a.m. | OK | GNU C++14 | TESTS | 28 | 77 | 819200 | ||
158146294 | ALLENhyk | C | May 23, 2022, 1:05 p.m. | OK | GNU C++14 | TESTS | 28 | 77 | 1638400 | ||
158149491 | Cauchico | C | May 23, 2022, 1:46 p.m. | OK | GNU C++14 | TESTS | 28 | 78 | 819200 | ||
158126040 | acwing_meow | C | May 23, 2022, 8:31 a.m. | OK | GNU C++17 | TESTS | 28 | 46 | 819200 | ||
158106747 | khsedo | C | May 23, 2022, 3:17 a.m. | OK | GNU C++17 | TESTS | 28 | 62 | 819200 | ||
158143988 | kobeforces | C | May 23, 2022, 12:39 p.m. | OK | GNU C++17 | TESTS | 28 | 62 | 819200 | ||
158263933 | XiaoTaoTao | C | May 24, 2022, 4:53 a.m. | OK | GNU C++17 | TESTS | 28 | 62 | 819200 | ||
158119641 | Shintaku | C | May 23, 2022, 6:54 a.m. | OK | GNU C++17 | TESTS | 28 | 62 | 3174400 | ||
158534794 | Tanxy | C | May 26, 2022, 1:57 p.m. | OK | GNU C++17 | TESTS | 28 | 62 | 3174400 | ||
158499473 | himanshukumarbhu | C | May 26, 2022, 7 a.m. | OK | GNU C++17 | TESTS | 28 | 78 | 819200 | ||
158412962 | lazy_armadillo | C | May 25, 2022, 5:24 p.m. | OK | GNU C++17 | TESTS | 28 | 78 | 819200 | ||
158394497 | SiriSola | C | May 25, 2022, 1:47 p.m. | OK | GNU C++17 | TESTS | 28 | 78 | 819200 | ||
158297173 | KAUSTUBH152003 | C | May 24, 2022, 12:30 p.m. | OK | GNU C++17 | TESTS | 28 | 78 | 819200 | ||
158362793 | xiece666 | C | May 25, 2022, 7:57 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 46 | 4812800 | ||
158522842 | black_trees | C | May 26, 2022, 11:50 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 62 | 819200 | ||
158133464 | under_scorer | C | May 23, 2022, 10:20 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 62 | 819200 | ||
158107837 | PCC | C | May 23, 2022, 3:40 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 62 | 6451200 | ||
158104572 | izumiQR | C | May 23, 2022, 2:27 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 77 | 2252800 | ||
158393468 | AFOier | C | May 25, 2022, 1:34 p.m. | OK | GNU C++17 (64) | TESTS | 28 | 77 | 11673600 | ||
158107066 | iamone | C | May 23, 2022, 3:24 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 78 | 4812800 | ||
158124445 | jamil314 | C | May 23, 2022, 8:07 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 78 | 21401600 | ||
158124251 | leo-sis | C | May 23, 2022, 8:03 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 93 | 8704000 | ||
158139830 | LiZnB | C | May 23, 2022, 11:47 a.m. | OK | GNU C++17 (64) | TESTS | 28 | 93 | 20684800 | ||
158113177 | bkifhr10 | C | May 23, 2022, 5:17 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 819200 | ||
158140877 | Bungmint | C | May 23, 2022, 11:59 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 819200 | ||
158153089 | No_pomegranates_ivan | C | May 23, 2022, 2:30 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 819200 | ||
158413031 | neolith | C | May 25, 2022, 5:25 p.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 819200 | ||
158581255 | clams | C | May 27, 2022, 5:14 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 819200 | ||
158130828 | OR-chi | C | May 23, 2022, 9:40 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 1638400 | ||
158107529 | YinLin | C | May 23, 2022, 3:33 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 1638400 | ||
158121616 | ninja31 | C | May 23, 2022, 7:24 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 1638400 | ||
158131700 | _ghost180 | C | May 23, 2022, 9:53 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 1638400 | ||
158107430 | WildBeast_07 | C | May 23, 2022, 3:31 a.m. | OK | GNU C++20 (64) | TESTS | 28 | 46 | 2252800 | ||
158141903 | poopoop | C | May 23, 2022, 12:12 p.m. | OK | Java 11 | TESTS | 28 | 187 | 0 | ||
158108220 | rachitagrawal1011 | C | May 23, 2022, 3:48 a.m. | OK | Java 11 | TESTS | 28 | 249 | 0 | ||
158112958 | gawsfbet | C | May 23, 2022, 5:14 a.m. | OK | Java 11 | TESTS | 28 | 280 | 921600 | ||
158104248 | 1364354238zxd | C | May 23, 2022, 2:18 a.m. | OK | Java 11 | TESTS | 28 | 280 | 4812800 | ||
158244931 | MrOtter | C | May 23, 2022, 8:40 p.m. | OK | Java 11 | TESTS | 28 | 280 | 8601600 | ||
158114165 | kartikpapney | C | May 23, 2022, 5:33 a.m. | OK | Java 11 | TESTS | 28 | 280 | 8601600 | ||
158112821 | satyaa_78 | C | May 23, 2022, 5:11 a.m. | OK | Java 11 | TESTS | 28 | 280 | 12288000 | ||
158153238 | nebula6611 | C | May 23, 2022, 2:32 p.m. | OK | Java 11 | TESTS | 28 | 295 | 7270400 | ||
158114040 | kartikpapney | C | May 23, 2022, 5:31 a.m. | OK | Java 11 | TESTS | 28 | 295 | 8601600 | ||
158406657 | suhas5979 | C | May 25, 2022, 4:07 p.m. | OK | Java 11 | TESTS | 28 | 296 | 6348800 | ||
158111528 | ITBeater | C | May 23, 2022, 4:53 a.m. | OK | Java 8 | TESTS | 28 | 155 | 0 | ||
158395434 | alibaba | C | May 25, 2022, 1:58 p.m. | OK | Java 8 | TESTS | 28 | 187 | 22220800 | ||
158129146 | kewosihuzuobudao | C | May 23, 2022, 9:16 a.m. | OK | Java 8 | TESTS | 28 | 217 | 4812800 | ||
158107431 | govindrajput | C | May 23, 2022, 3:31 a.m. | OK | Java 8 | TESTS | 28 | 217 | 12800000 | ||
158109405 | sharma_ji_420 | C | May 23, 2022, 4:13 a.m. | OK | Java 8 | TESTS | 28 | 218 | 11059200 | ||
158108958 | priority_is_greedy | C | May 23, 2022, 4:04 a.m. | OK | Java 8 | TESTS | 28 | 218 | 11059200 | ||
158136585 | _ryan18_ | C | May 23, 2022, 11:06 a.m. | OK | Java 8 | TESTS | 28 | 233 | 14233600 | ||
158394272 | Swapniltri | C | May 25, 2022, 1:44 p.m. | OK | Java 8 | TESTS | 28 | 233 | 14336000 | ||
158566538 | 28leoleo28 | C | May 26, 2022, 9:08 p.m. | OK | Java 8 | TESTS | 28 | 233 | 14848000 | ||
158152256 | r3hab.rs | C | May 23, 2022, 2:20 p.m. | OK | Java 8 | TESTS | 28 | 234 | 13107200 | ||
158246897 | Bloodwyn | C | May 23, 2022, 9:24 p.m. | OK | Kotlin 1.6 | TESTS | 28 | 389 | 18329600 | ||
158330605 | housni | C | May 24, 2022, 6:59 p.m. | OK | Kotlin 1.6 | TESTS | 28 | 530 | 18944000 | ||
158134139 | peanutbutter1 | C | May 23, 2022, 10:30 a.m. | OK | MS C++ 2017 | TESTS | 28 | 109 | 8601600 | ||
158104745 | CSUST_GXL | C | May 23, 2022, 2:31 a.m. | OK | MS C++ 2017 | TESTS | 28 | 155 | 6451200 | ||
158266970 | touxinzei | C | May 24, 2022, 5:43 a.m. | OK | MS C++ 2017 | TESTS | 28 | 171 | 6451200 | ||
158104428 | Lucky16 | C | May 23, 2022, 2:23 a.m. | OK | MS C++ 2017 | TESTS | 28 | 202 | 3174400 | ||
158128075 | Dakericy | C | May 23, 2022, 9 a.m. | OK | MS C++ 2017 | TESTS | 28 | 218 | 7782400 | ||
158110307 | bhdtr | C | May 23, 2022, 4:31 a.m. | OK | MS C++ 2017 | TESTS | 28 | 234 | 6963200 | ||
158291872 | xsc | C | May 24, 2022, 11:26 a.m. | OK | MS C++ 2017 | TESTS | 28 | 249 | 7270400 | ||
158281055 | kitbuilder | C | May 24, 2022, 9:02 a.m. | OK | MS C++ 2017 | TESTS | 28 | 265 | 7270400 | ||
158148464 | Kanata369 | C | May 23, 2022, 1:32 p.m. | OK | MS C++ 2017 | TESTS | 28 | 265 | 10547200 | ||
158119158 | adesh123 | C | May 23, 2022, 6:48 a.m. | OK | MS C++ 2017 | TESTS | 28 | 280 | 6451200 | ||
158104629 | XYShaoKang | C | May 23, 2022, 2:28 a.m. | OK | Node.js | TESTS | 28 | 202 | 36966400 | ||
158309507 | YMSeah | C | May 24, 2022, 2:48 p.m. | OK | PyPy 3 | TESTS | 28 | 155 | 21708800 | ||
158310563 | YMSeah | C | May 24, 2022, 2:59 p.m. | OK | PyPy 3 | TESTS | 28 | 202 | 23552000 | ||
158240231 | hxu10 | C | May 23, 2022, 7:16 p.m. | OK | PyPy 3 | TESTS | 28 | 280 | 32153600 | ||
158122190 | pranay_28 | C | May 23, 2022, 7:32 a.m. | OK | PyPy 3 | TESTS | 28 | 311 | 17817600 | ||
158307826 | ambs_ | C | May 24, 2022, 2:30 p.m. | OK | PyPy 3 | TESTS | 28 | 327 | 22118400 | ||
158243434 | ON_THE_EDGE | C | May 23, 2022, 8:11 p.m. | OK | PyPy 3 | TESTS | 28 | 358 | 22528000 | ||
158106640 | mmooyyii | C | May 23, 2022, 3:15 a.m. | OK | PyPy 3 | TESTS | 28 | 436 | 25190400 | ||
158306757 | JohnX4321 | C | May 24, 2022, 2:18 p.m. | OK | PyPy 3 | TESTS | 28 | 452 | 21401600 | ||
158502945 | Sufiyan18 | C | May 26, 2022, 7:46 a.m. | OK | PyPy 3 | TESTS | 28 | 452 | 22835200 | ||
158323308 | shuklautkarsh7007 | C | May 24, 2022, 5:23 p.m. | OK | PyPy 3 | TESTS | 28 | 483 | 22220800 | ||
158334432 | Akbar_23 | C | May 24, 2022, 8:10 p.m. | OK | PyPy 3-64 | TESTS | 28 | 140 | 36454400 | ||
158143645 | tushar26427 | C | May 23, 2022, 12:35 p.m. | OK | PyPy 3-64 | TESTS | 28 | 171 | 34611200 | ||
158135440 | skp_r | C | May 23, 2022, 10:50 a.m. | OK | PyPy 3-64 | TESTS | 28 | 171 | 38092800 | ||
158288218 | pratyanch_jain | C | May 24, 2022, 10:41 a.m. | OK | PyPy 3-64 | TESTS | 28 | 202 | 40960000 | ||
158152309 | zeero1778 | C | May 23, 2022, 2:20 p.m. | OK | PyPy 3-64 | TESTS | 28 | 280 | 33177600 | ||
158148610 | DarkHorse_it_iz | C | May 23, 2022, 1:34 p.m. | OK | PyPy 3-64 | TESTS | 28 | 280 | 33382400 | ||
158274953 | abineth | C | May 24, 2022, 7:41 a.m. | OK | PyPy 3-64 | TESTS | 28 | 295 | 29900800 | ||
158119186 | aman404found | C | May 23, 2022, 6:48 a.m. | OK | PyPy 3-64 | TESTS | 28 | 296 | 33689600 | ||
158107306 | ikzzi | C | May 23, 2022, 3:28 a.m. | OK | PyPy 3-64 | TESTS | 28 | 311 | 33996800 | ||
158388050 | satyamshrma | C | May 25, 2022, 12:31 p.m. | OK | PyPy 3-64 | TESTS | 28 | 327 | 34406400 | ||
158253650 | CodeLike | C | May 24, 2022, 1:25 a.m. | OK | Python 3 | TESTS | 28 | 155 | 16793600 | ||
158122208 | iron_nicko | C | May 23, 2022, 7:32 a.m. | OK | Python 3 | TESTS | 28 | 156 | 16384000 | ||
158230912 | deepaklaksman | C | May 23, 2022, 5:19 p.m. | OK | Python 3 | TESTS | 28 | 202 | 16384000 | ||
158360140 | pennymagic156 | C | May 25, 2022, 7:19 a.m. | OK | Python 3 | TESTS | 28 | 202 | 16486400 | ||
158124592 | Hacker315 | C | May 23, 2022, 8:09 a.m. | OK | Python 3 | TESTS | 28 | 202 | 16486400 | ||
158494995 | Eldababa | C | May 26, 2022, 6:04 a.m. | OK | Python 3 | TESTS | 28 | 217 | 16793600 | ||
158321487 | WhyAsh5114 | C | May 24, 2022, 5:01 p.m. | OK | Python 3 | TESTS | 28 | 233 | 15769600 | ||
158487409 | sranbir | C | May 26, 2022, 4 a.m. | OK | Python 3 | TESTS | 28 | 233 | 16691200 | ||
158109270 | jgsr031200 | C | May 23, 2022, 4:10 a.m. | OK | Python 3 | TESTS | 28 | 233 | 16793600 | ||
158321451 | WhyAsh5114 | C | May 24, 2022, 5:01 p.m. | OK | Python 3 | TESTS | 28 | 234 | 15769600 |
Back to search problems