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 |
---|---|---|---|---|---|---|
1381 | Codeforces Round 658 (Div. 1) | FINISHED | False | 7200 | 142010711 | July 21, 2020, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 9028 ) | B | Unmerge | PROGRAMMING | combinatorics dp two pointers | 1800 |
B'Let a and b be two arrays of lengths n and m , respectively, with no elements in common. We can define a new array mathrm{merge}(a,b) of length n+m recursively as follows: This algorithm has the nice property that if a and b are sorted, then mathrm{merge}(a,b) will also be sorted. For example, it is used as a subroutine in merge-sort. For this problem, however, we will consider the same procedure acting on non-sorted arrays as well. For example, if a=[3,1] and b=[2,4] , then mathrm{merge}(a,b)=[2,3,1,4] . A permutation is an array consisting of n distinct integers from 1 to n in arbitrary order. For example, [2,3,1,5,4] is a permutation, but [1,2,2] is not a permutation ( 2 appears twice in the array) and [1,3,4] is also not a permutation ( n=3 but there is 4 in the array). There is a permutation p of length 2n . Determine if there exist two arrays a and b , each of length n and with no elements in common, so that p= mathrm{merge}(a,b) . The first line contains a single integer t ( 1 <= t <= 1000 ) -- the number of test cases. Next 2t lines contain descriptions of test cases. The first line of each test case contains a single integer n ( 1 <= n <= 2000 ). The second line of each test case contains 2n integers p_1, ldots,p_{2n} ( 1 <= p_i <= 2n ). It is guaranteed that p is a permutation. It is guaranteed that the sum of n across all test cases does not exceed 2000 . For each test case, output "YES" if there exist arrays a , b , each of length n and with no common elements, so that p= mathrm{merge}(a,b) . Otherwise, output "NO". In the first test case, [2,3,1,4]= mathrm{merge}([3,1],[2,4]) . In the second test case, we can show that [3,1,2,4] is not the merge of two arrays of length 2 . In the third test '... |
Codeforces Round #658 Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
87573062 | Gassa | B | July 21, 2020, 3:49 p.m. | OK | D | TESTS | 32 | 31 | 8908800 | 1800 | |
87597620 | Gassa | B | July 21, 2020, 5:31 p.m. | OK | D | TESTS | 32 | 31 | 8908800 | 1800 | |
87575710 | daut-dlang | B | July 21, 2020, 3:55 p.m. | OK | D | TESTS | 32 | 46 | 8908800 | 1800 | |
87536512 | hos.lyric | B | July 21, 2020, 2:49 p.m. | OK | D | TESTS | 32 | 77 | 35430400 | 1800 | |
87552153 | about | B | July 21, 2020, 3:11 p.m. | OK | GNU C11 | TESTS | 32 | 31 | 3788800 | 1800 | |
87552547 | 1207koo | B | July 21, 2020, 3:12 p.m. | OK | GNU C11 | TESTS | 32 | 31 | 3788800 | 1800 | |
87545512 | ztc. | B | July 21, 2020, 3:01 p.m. | OK | GNU C++11 | TESTS | 32 | 15 | 3686400 | 1800 | |
87560041 | 2sozx | B | July 21, 2020, 3:25 p.m. | OK | GNU C++11 | TESTS | 32 | 15 | 3993600 | 1800 | |
87573271 | Y25t | B | July 21, 2020, 3:50 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 3686400 | 1800 | |
87580761 | Sneakoscope | B | July 21, 2020, 4:06 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 3891200 | 1800 | |
87552009 | xymtxdy | B | July 21, 2020, 3:11 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 3891200 | 1800 | |
87547908 | EmptySoulist | B | July 21, 2020, 3:05 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 3891200 | 1800 | |
87585391 | liangjingtao | B | July 21, 2020, 4:17 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 3891200 | 1800 | |
87568659 | ws_zzyer | B | July 21, 2020, 3:41 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 3993600 | 1800 | |
87576441 | zhangguangxuan99 | B | July 21, 2020, 3:57 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 4096000 | 1800 | |
87573770 | xumingyang | B | July 21, 2020, 3:51 p.m. | OK | GNU C++11 | TESTS | 32 | 30 | 15974400 | 1800 | |
87558991 | kiyoshi0205 | B | July 21, 2020, 3:23 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3686400 | 1800 | |
87596612 | tejas_919 | B | July 21, 2020, 5:26 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87602865 | Evilandrew | B | July 21, 2020, 6:12 p.m. | OK | GNU C++14 | TESTS | 33 | 31 | 3788800 | 1800 | |
87598117 | RedDreamer | B | July 21, 2020, 5:33 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87596489 | ikura355 | B | July 21, 2020, 5:26 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87586048 | alimq | B | July 21, 2020, 4:19 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87581624 | romi_sm | B | July 21, 2020, 4:08 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87581491 | zzq229 | B | July 21, 2020, 4:08 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87578882 | 21August | B | July 21, 2020, 4:02 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87574691 | Turkey | B | July 21, 2020, 3:53 p.m. | OK | GNU C++14 | TESTS | 32 | 31 | 3788800 | 1800 | |
87553756 | Arpa | B | July 21, 2020, 3:14 p.m. | OK | GNU C++17 | TESTS | 32 | 31 | 3686400 | 1800 | |
87632266 | t1fa | B | July 22, 2020, 4:36 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 3788800 | 1800 | |
87623666 | dimdim | B | July 22, 2020, 1:38 a.m. | OK | GNU C++17 | TESTS | 33 | 31 | 3788800 | 1800 | |
87621748 | IsaacMoris | B | July 22, 2020, 12:40 a.m. | OK | GNU C++17 | TESTS | 33 | 31 | 3788800 | 1800 | |
87619272 | run_time_terror | B | July 21, 2020, 11:05 p.m. | OK | GNU C++17 | TESTS | 33 | 31 | 3788800 | 1800 | |
87619258 | run_time_terror | B | July 21, 2020, 11:04 p.m. | OK | GNU C++17 | TESTS | 33 | 31 | 3788800 | 1800 | |
87600036 | Radewoosh | B | July 21, 2020, 5:47 p.m. | OK | GNU C++17 | TESTS | 33 | 31 | 3788800 | 1800 | |
87597446 | Radewoosh | B | July 21, 2020, 5:30 p.m. | OK | GNU C++17 | TESTS | 32 | 31 | 3788800 | 1800 | |
87623930 | dimdim | B | July 22, 2020, 1:45 a.m. | OK | GNU C++17 | TESTS | 33 | 31 | 3788800 | 1800 | |
87631978 | WaAccept | B | July 22, 2020, 4:31 a.m. | OK | GNU C++17 | TESTS | 34 | 31 | 3788800 | 1800 | |
87568120 | Emilan | B | July 21, 2020, 3:39 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4300800 | 1800 | |
87572013 | KKT_89 | B | July 21, 2020, 3:47 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4300800 | 1800 | |
87568985 | HCPS42 | B | July 21, 2020, 3:41 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4300800 | 1800 | |
87540719 | Kostroma | B | July 21, 2020, 2:54 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4300800 | 1800 | |
87541971 | PinkRabbit | B | July 21, 2020, 2:56 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4403200 | 1800 | |
87543410 | crackersamdjam | B | July 21, 2020, 2:58 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4403200 | 1800 | |
87578322 | Vasyl_Protsiv | B | July 21, 2020, 4:01 p.m. | OK | GNU C++17 (64) | TESTS | 32 | 30 | 4403200 | 1800 | |
87602654 | Koo_ | B | July 21, 2020, 6:10 p.m. | OK | GNU C++17 (64) | TESTS | 33 | 31 | 4300800 | 1800 | |
87630301 | vok8 | B | July 22, 2020, 4 a.m. | OK | GNU C++17 (64) | TESTS | 34 | 31 | 4300800 | 1800 | |
87629370 | feiko | B | July 22, 2020, 3:43 a.m. | OK | GNU C++17 (64) | TESTS | 34 | 31 | 4300800 | 1800 | |
87564173 | Xylenox | B | July 21, 2020, 3:32 p.m. | OK | Go | TESTS | 32 | 46 | 15155200 | 1800 | |
87551718 | cirno3153 | B | July 21, 2020, 3:10 p.m. | OK | Java 11 | TESTS | 32 | 187 | 27648000 | 1800 | |
87557335 | awesomelemonade | B | July 21, 2020, 3:20 p.m. | OK | Java 11 | TESTS | 32 | 202 | 23859200 | 1800 | |
87569516 | mphillotry | B | July 21, 2020, 3:42 p.m. | OK | Java 11 | TESTS | 32 | 202 | 23859200 | 1800 | |
87549394 | uwi | B | July 21, 2020, 3:07 p.m. | OK | Java 11 | TESTS | 32 | 202 | 23961600 | 1800 | |
87550669 | PizzaLovers007 | B | July 21, 2020, 3:09 p.m. | OK | Java 11 | TESTS | 32 | 202 | 30208000 | 1800 | |
87607488 | CCS_Covenant | B | July 21, 2020, 7:03 p.m. | OK | Java 11 | TESTS | 33 | 248 | 24473600 | 1800 | |
87583348 | phantom11 | B | July 21, 2020, 4:12 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20480000 | 1800 | |
87568002 | shilov | B | July 21, 2020, 3:39 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20480000 | 1800 | |
87553814 | holeguma | B | July 21, 2020, 3:14 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20480000 | 1800 | |
87552631 | AnandOza | B | July 21, 2020, 3:12 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20480000 | 1800 | |
87574708 | BNL | B | July 21, 2020, 3:53 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20480000 | 1800 | |
87607279 | mwen | B | July 21, 2020, 7:01 p.m. | OK | Java 8 | TESTS | 33 | 124 | 20480000 | 1800 | |
87593707 | barakraganosungam | B | July 21, 2020, 4:33 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20480000 | 1800 | |
87577743 | Failure | B | July 21, 2020, 4 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20582400 | 1800 | |
87569805 | NewtScamander | B | July 21, 2020, 3:43 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20684800 | 1800 | |
87564099 | DarLam | B | July 21, 2020, 3:32 p.m. | OK | Java 8 | TESTS | 32 | 124 | 20787200 | 1800 | |
87553527 | ekaerovets | B | July 21, 2020, 3:14 p.m. | OK | Kotlin | TESTS | 32 | 124 | 20480000 | 1800 | |
87553415 | Hakiobo | B | July 21, 2020, 3:13 p.m. | OK | Kotlin | TESTS | 32 | 140 | 22323200 | 1800 | |
87566060 | golions | B | July 21, 2020, 3:35 p.m. | OK | Kotlin | TESTS | 32 | 171 | 21401600 | 1800 | |
87540037 | Tlatoani | B | July 21, 2020, 2:53 p.m. | OK | Kotlin | TESTS | 32 | 171 | 21606400 | 1800 | |
87579727 | batkhuyag | B | July 21, 2020, 4:04 p.m. | OK | Kotlin | TESTS | 32 | 249 | 21708800 | 1800 | |
87561399 | EmK | B | July 21, 2020, 3:27 p.m. | OK | Mono C# | TESTS | 32 | 77 | 12800000 | 1800 | |
87570996 | Yupiteru | B | July 21, 2020, 3:45 p.m. | OK | Mono C# | TESTS | 32 | 77 | 13209600 | 1800 | |
87556137 | keymoon | B | July 21, 2020, 3:18 p.m. | OK | Mono C# | TESTS | 32 | 77 | 15462400 | 1800 | |
87568837 | terry_u16 | B | July 21, 2020, 3:41 p.m. | OK | Mono C# | TESTS | 32 | 93 | 15052800 | 1800 | |
87574809 | mban259 | B | July 21, 2020, 3:53 p.m. | OK | Mono C# | TESTS | 32 | 109 | 15667200 | 1800 | |
87554210 | Pnn1337 | B | July 21, 2020, 3:15 p.m. | OK | MS C++ 2017 | TESTS | 32 | 31 | 3993600 | 1800 | |
87578187 | P___ | B | July 21, 2020, 4:01 p.m. | OK | MS C++ 2017 | TESTS | 32 | 31 | 3993600 | 1800 | |
87541123 | pichulia | B | July 21, 2020, 2:55 p.m. | OK | MS C++ 2017 | TESTS | 32 | 31 | 3993600 | 1800 | |
87577634 | Numbervan | B | July 21, 2020, 3:59 p.m. | OK | MS C++ 2017 | TESTS | 32 | 31 | 4300800 | 1800 | |
87561720 | Friska | B | July 21, 2020, 3:28 p.m. | OK | MS C++ 2017 | TESTS | 32 | 46 | 3788800 | 1800 | |
87564899 | Gravekper | B | July 21, 2020, 3:33 p.m. | OK | MS C++ 2017 | TESTS | 32 | 46 | 3788800 | 1800 | |
87605545 | kupriyanov | B | July 21, 2020, 6:40 p.m. | OK | MS C++ 2017 | TESTS | 33 | 46 | 3788800 | 1800 | |
87554794 | Baharevim | B | July 21, 2020, 3:16 p.m. | OK | MS C++ 2017 | TESTS | 32 | 46 | 11776000 | 1800 | |
87576221 | tarattata1 | B | July 21, 2020, 3:56 p.m. | OK | MS C++ 2017 | TESTS | 32 | 46 | 36147200 | 1800 | |
87543827 | pajenegod | B | July 21, 2020, 2:59 p.m. | OK | PyPy 2 | TESTS | 32 | 124 | 24678400 | 1800 | |
87584117 | exoji2e | B | July 21, 2020, 4:14 p.m. | OK | PyPy 2 | TESTS | 32 | 202 | 26726400 | 1800 | |
87553131 | titia | B | July 21, 2020, 3:13 p.m. | OK | PyPy 3 | TESTS | 32 | 170 | 23449600 | 1800 | |
87599211 | CKP_ | B | July 21, 2020, 5:40 p.m. | OK | PyPy 3 | TESTS | 32 | 170 | 23654400 | 1800 | |
87578833 | nagitaosu | B | July 21, 2020, 4:02 p.m. | OK | PyPy 3 | TESTS | 32 | 171 | 23040000 | 1800 | |
87569041 | SPD_9X2 | B | July 21, 2020, 3:41 p.m. | OK | PyPy 3 | TESTS | 32 | 202 | 23449600 | 1800 | |
87582242 | tanon710 | B | July 21, 2020, 4:10 p.m. | OK | PyPy 3 | TESTS | 32 | 202 | 32972800 | 1800 | |
87561199 | archittect | B | July 21, 2020, 3:27 p.m. | OK | PyPy 3 | TESTS | 32 | 202 | 32972800 | 1800 | |
87572879 | SalimAboubacar | B | July 21, 2020, 3:49 p.m. | OK | PyPy 3 | TESTS | 32 | 202 | 33280000 | 1800 | |
87557025 | neterukun | B | July 21, 2020, 3:19 p.m. | OK | PyPy 3 | TESTS | 32 | 217 | 24473600 | 1800 | |
87574534 | jayantjain100 | B | July 21, 2020, 3:53 p.m. | OK | PyPy 3 | TESTS | 32 | 217 | 33382400 | 1800 | |
87621279 | throwawayatcoder | B | July 22, 2020, 12:21 a.m. | OK | PyPy 3 | TESTS | 33 | 218 | 88576000 | 1800 | |
87574222 | Hitikkumar | B | July 21, 2020, 3:52 p.m. | OK | Python 2 | TESTS | 32 | 763 | 18534400 | 1800 | |
87622875 | mkawa2 | B | July 22, 2020, 1:17 a.m. | OK | Python 3 | TESTS | 33 | 109 | 6963200 | 1800 | |
87560612 | ngtkana | B | July 21, 2020, 3:26 p.m. | OK | Rust | TESTS | 32 | 31 | 4096000 | 1800 | |
87559413 | cotton100pc | B | July 21, 2020, 3:24 p.m. | OK | Rust | TESTS | 32 | 31 | 4096000 | 1800 | |
87556087 | Russell_Emerine | B | July 21, 2020, 3:18 p.m. | OK | Rust | TESTS | 32 | 46 | 3891200 | 1800 | |
87598458 | sansen | B | July 21, 2020, 5:35 p.m. | OK | Rust | TESTS | 32 | 46 | 4096000 | 1800 | |
87560255 | sansen | B | July 21, 2020, 3:25 p.m. | OK | Rust | TESTS | 32 | 46 | 4198400 | 1800 |
Back to search problems