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 |
---|---|---|---|---|---|---|
1468 | 2020-2021 ICPC, NERC, Southern and Volga Russian Regional Contest (Online Mirror, ICPC Rules) | FINISHED | False | 18000 | 122927099 | Dec. 25, 2020, 11:35 a.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 1829 ) | H | K and Medians | PROGRAMMING | constructive algorithms math |
B"Let's denote the median of a sequence s with odd length as the value in the middle of s if we sort s in non-decreasing order. For example, let s = [1, 2, 5, 7, 2, 3, 12] . After sorting, we get sequence [1, 2, 2, underline{3}, 5, 7, 12] , and the median is equal to 3 . You have a sequence of n integers [1, 2, ... , n] and an odd integer k . In one step, you choose any k elements from the sequence and erase all chosen elements except their median. These elements do not have to go continuously (gaps are allowed between them). For example, if you have a sequence [1, 2, 3, 4, 5, 6, 7] (i.e. n=7 ) and k = 3 , then the following options for the first step are possible: You can do zero or more steps. Can you get a sequence b_1 , b_2 , ..., b_m after several steps? You'll be given t test cases. Solve each test case independently. The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. The first line of each test case contains three integers n , k , and m ( 3 <= n <= 2 cdot 10^5 ; 3 <= k <= n ; k is odd; 1 <= m < n ) -- the length of the sequence you have, the number of elements you choose in each step and the length of the sequence you'd like to get. The second line of each test case contains m integers b_1, b_2, ... , b_m ( 1 <= b_1 < b_2 < ... < b_m <= n ) -- the sequence you'd like to get, given in the ascending order. It's guaranteed that the total sum of n over all test cases doesn't exceed 2 cdot 10^5 . For each test case, print YES if you can obtain the sequence b or NO otherwise. You may print each letter in any case (for example, YES, Yes, yes, yEs will all be recognized as positive answer). In the first test case, you have sequence [1, 2, 3] . Since k = 3 you have only one way to choose k elements -- it's to c"... |
Tutorial (PDF) |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
102335297 | i_m_a | H | Dec. 25, 2020, 4:04 p.m. | OK | GNU C++11 | TESTS | 58 | 31 | 1433600 | ||
102357412 | hs-black | H | Dec. 25, 2020, 11:37 p.m. | OK | GNU C++11 | TESTS | 58 | 31 | 2457600 | ||
102358474 | Zechariah_2001 | H | Dec. 26, 2020, 12:29 a.m. | OK | GNU C++11 | TESTS | 58 | 31 | 3993600 | ||
102322682 | serverkiller zkdxl | H | Dec. 25, 2020, 2:15 p.m. | OK | GNU C++11 | TESTS | 58 | 31 | 11980800 | ||
102361259 | C20192413 | H | Dec. 26, 2020, 2:35 a.m. | OK | GNU C++11 | TESTS | 58 | 46 | 204800 | ||
102325887 | l_h_j thu2022yz OOmega | H | Dec. 25, 2020, 2:41 p.m. | OK | GNU C++11 | TESTS | 58 | 46 | 204800 | ||
102362686 | Lucky_Glass | H | Dec. 26, 2020, 3:31 a.m. | OK | GNU C++11 | TESTS | 58 | 46 | 614400 | ||
102328062 | Sugarii Apsara Orenji.Sora | H | Dec. 25, 2020, 2:59 p.m. | OK | GNU C++11 | TESTS | 58 | 46 | 819200 | ||
102318299 | BigBag | H | Dec. 25, 2020, 1:39 p.m. | OK | GNU C++11 | TESTS | 58 | 46 | 819200 | ||
102310882 | Isonan LJC00118 mocania | H | Dec. 25, 2020, 12:41 p.m. | OK | GNU C++11 | TESTS | 58 | 46 | 819200 | ||
102317130 | ConanYu SprinkleYu Madeline | H | Dec. 25, 2020, 1:29 p.m. | OK | GNU C++14 | TESTS | 58 | 61 | 819200 | ||
102336679 | Naseem17 Captain_Knuckles _Mugiwara_ | H | Dec. 25, 2020, 4:21 p.m. | OK | GNU C++14 | TESTS | 58 | 61 | 1024000 | ||
102335965 | savish28 Tanmay_21 adarsh7777 | H | Dec. 25, 2020, 4:12 p.m. | OK | GNU C++14 | TESTS | 58 | 61 | 3072000 | ||
102326101 | Nero | H | Dec. 25, 2020, 2:42 p.m. | OK | GNU C++14 | TESTS | 58 | 61 | 3174400 | ||
102322758 | seastar105 semteo04 shiftpsh | H | Dec. 25, 2020, 2:16 p.m. | OK | GNU C++14 | TESTS | 58 | 61 | 3584000 | ||
102337060 | ccutyear | H | Dec. 25, 2020, 4:26 p.m. | OK | GNU C++14 | TESTS | 58 | 62 | 0 | ||
102320142 | lucaperju ivan.tudor apostoldaniel854 | H | Dec. 25, 2020, 1:55 p.m. | OK | GNU C++14 | TESTS | 58 | 62 | 0 | ||
102359050 | nandonathaniel | H | Dec. 26, 2020, 12:57 a.m. | OK | GNU C++14 | TESTS | 58 | 62 | 512000 | ||
102326191 | harshit15 | H | Dec. 25, 2020, 2:43 p.m. | OK | GNU C++14 | TESTS | 58 | 62 | 716800 | ||
102318053 | Kalptaru _baba_yaga Wernier | H | Dec. 25, 2020, 1:37 p.m. | OK | GNU C++14 | TESTS | 58 | 62 | 716800 | ||
102326644 | Aphelios | H | Dec. 25, 2020, 2:46 p.m. | OK | GNU C++17 | TESTS | 58 | 46 | 2457600 | ||
102326406 | WA_King | H | Dec. 25, 2020, 2:45 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 716800 | ||
102330694 | Codingsince19 Shivam_18 karanagarwalla | H | Dec. 25, 2020, 3:21 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 819200 | ||
102330479 | StefanSebez TadijaSebez | H | Dec. 25, 2020, 3:19 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 819200 | ||
102336276 | TudorTismaneanu | H | Dec. 25, 2020, 4:16 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 1433600 | ||
102316549 | DenOMINATOR rivalq CoderAnshu | H | Dec. 25, 2020, 1:25 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 1638400 | ||
102333774 | dasper dickynovanto1103 | H | Dec. 25, 2020, 3:49 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 2457600 | ||
102325504 | Hyperbolic | H | Dec. 25, 2020, 2:38 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 2457600 | ||
102311483 | Elegia tEMMIE.w. EricHuang2003 | H | Dec. 25, 2020, 12:45 p.m. | OK | GNU C++17 | TESTS | 58 | 61 | 3993600 | ||
102361203 | Geralt-of-Rivia | H | Dec. 26, 2020, 2:32 a.m. | OK | GNU C++17 | TESTS | 58 | 61 | 7987200 | ||
102313064 | QAQAutoMaton PinkRabbit | H | Dec. 25, 2020, 12:57 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 31 | 5836800 | ||
102326386 | Maripium | H | Dec. 25, 2020, 2:44 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 0 | ||
102321399 | Tiramister | H | Dec. 25, 2020, 2:05 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 0 | ||
102310919 | tourist | H | Dec. 25, 2020, 12:41 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 0 | ||
102328679 | suta kiyoshi0205 shiro53 | H | Dec. 25, 2020, 3:04 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 716800 | ||
102313304 | aleex Quartermelon Paliukh | H | Dec. 25, 2020, 12:59 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 716800 | ||
102361298 | Danielzyc | H | Dec. 26, 2020, 2:37 a.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 819200 | ||
102355891 | hugh.jass | H | Dec. 25, 2020, 10:26 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 819200 | ||
102345000 | rath772k | H | Dec. 25, 2020, 6:33 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 819200 | ||
102340654 | Thallium_is_Vegetable | H | Dec. 25, 2020, 5:26 p.m. | OK | GNU C++17 (64) | TESTS | 58 | 46 | 819200 | ||
102325122 | insert_cool_handle | H | Dec. 25, 2020, 2:34 p.m. | OK | Java 11 | TESTS | 58 | 202 | 0 | ||
102336329 | DishonoredRighteous iakovlev.zakhar golikovnik | H | Dec. 25, 2020, 4:17 p.m. | OK | Java 8 | TESTS | 58 | 140 | 0 | ||
102329553 | 7dan | H | Dec. 25, 2020, 3:12 p.m. | OK | Java 8 | TESTS | 58 | 155 | 0 | ||
102329089 | FireBird23 | H | Dec. 25, 2020, 3:08 p.m. | OK | PyPy 3 | TESTS | 58 | 233 | 18944000 | ||
102330794 | SPD_9X2 | H | Dec. 25, 2020, 3:22 p.m. | OK | PyPy 3 | TESTS | 58 | 248 | 16486400 | ||
102368177 | Kira_1234 | H | Dec. 26, 2020, 5:52 a.m. | OK | PyPy 3 | TESTS | 58 | 265 | 15974400 | ||
102360535 | 510030805voidf | H | Dec. 26, 2020, 2:03 a.m. | OK | PyPy 3 | TESTS | 58 | 280 | 16691200 | ||
102321275 | semjon.00 Crisp0r Pneumokogur8 | H | Dec. 25, 2020, 2:04 p.m. | OK | PyPy 3 | TESTS | 58 | 280 | 17203200 | ||
102316143 | wow_ok FlakeLCR conqueror_of_tourist | H | Dec. 25, 2020, 1:22 p.m. | OK | PyPy 3 | TESTS | 58 | 296 | 17305600 | ||
102360481 | 510030805voidf | H | Dec. 26, 2020, 2 a.m. | OK | PyPy 3 | TESTS | 58 | 358 | 16998400 | ||
102345400 | Satwik_Tiwari | H | Dec. 25, 2020, 6:39 p.m. | OK | PyPy 3 | TESTS | 58 | 468 | 25702400 | ||
102351758 | sh1194 | H | Dec. 25, 2020, 8:24 p.m. | OK | Python 3 | TESTS | 58 | 186 | 17510400 | ||
102351678 | sh1194 | H | Dec. 25, 2020, 8:23 p.m. | OK | Python 3 | TESTS | 58 | 186 | 17510400 | ||
102351639 | sh1194 | H | Dec. 25, 2020, 8:23 p.m. | OK | Python 3 | TESTS | 58 | 187 | 17408000 | ||
102351583 | sh1194 | H | Dec. 25, 2020, 8:22 p.m. | OK | Python 3 | TESTS | 58 | 187 | 17510400 | ||
102319725 | sansen | H | Dec. 25, 2020, 1:51 p.m. | OK | Rust | TESTS | 58 | 46 | 3686400 | ||
102293617 | H | Dec. 25, 2020, 9:38 a.m. | OK | Unknown | TESTS | 0 | 0 | 0 |
Back to search problems