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 |
---|---|---|---|---|---|---|
1831 | Codeforces Round 875 (Div. 2) | FINISHED | False | 9000 | 51981863 | May 28, 2023, 2:35 p.m. |
Solved$ |
Index |
Name |
Type |
Tags |
Community Tag |
Rating |
---|---|---|---|---|---|---|
( 22385 ) | B | Array merging | PROGRAMMING | constructive algorithms greedy |
B'You are given two arrays a and b both of length n . You will merge ^ dagger these arrays forming another array c of length 2 cdot n . You have to find the maximum length of a subarray consisting of equal values across all arrays c that could be obtained. ^ dagger A merge of two arrays results in an array c composed by successively taking the first element of either array (as long as that array is nonempty) and removing it. After this step, the element is appended to the back of c . We repeat this operation as long as we can (i.e. at least one array is nonempty). Each test contains multiple test cases. The first line of input contains a single integer t ( 1 <= t <= 10^4 ) -- 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 <= 2 cdot 10^5 ) -- the length of the array a and b . The second line of each test case contains n integers a_1,a_2, ldots,a_n ( 1 <= a_i <= 2 cdot n ) -- the elements of array a . The third line of each test case contains n integers b_1,b_2, ldots,b_n ( 1 <= b_i <= 2 cdot n ) -- the elements of array b . It is guaranteed that the sum of n across all test cases does not exceed 2 cdot 10^5 . For each test case, output the maximum length of a subarray consisting of equal values across all merges. In the first test case, we can only make c=[2,2] , thus the answer is 2 . In the second test case, since all values are distinct, the answer must be 1 . In the third test case, the arrays c we can make are [1,2,1,2] , [1,2,2,1] , [2,1,1,2] , [2,1,2,1] . We can see that the answer is 2 when we choose c=[1,2,2,1] . '... |
Codeforces Round #875 (Div.1 + Div. 2) Editorial |
Submission Id |
Author(s) |
Index |
Submitted |
Verdict |
Language |
Test Set |
Tests Passed |
Time taken (ms) |
Memory Consumed (bytes) |
Tags |
Rating |
---|---|---|---|---|---|---|---|---|---|---|---|
207663572 | sanju77 | B | May 28, 2023, 4:55 p.m. | OK | GNU C11 | TESTS | 12 | 93 | 6348800 | ||
207664868 | astronom1cal | B | May 28, 2023, 4:58 p.m. | OK | GNU C11 | TESTS | 12 | 109 | 9625600 | ||
207659545 | aash8a9 | B | May 28, 2023, 4:44 p.m. | OK | GNU C11 | TESTS | 12 | 140 | 4812800 | ||
207675797 | saminsadaf7 | B | May 28, 2023, 6:24 p.m. | OK | GNU C++14 | TESTS | 12 | 78 | 4812800 | ||
207690611 | ahmedmekawyxa | B | May 28, 2023, 10:57 p.m. | OK | GNU C++14 | TESTS | 12 | 78 | 4812800 | ||
207713142 | 8770644753 | B | May 29, 2023, 4:57 a.m. | OK | GNU C++14 | TESTS | 12 | 78 | 4812800 | ||
207693919 | 2018ljw | B | May 29, 2023, 12:57 a.m. | OK | GNU C++14 | TESTS | 12 | 93 | 3174400 | ||
207665925 | hkr04 | B | May 28, 2023, 5:01 p.m. | OK | GNU C++14 | TESTS | 12 | 93 | 3174400 | ||
207708262 | astall | B | May 29, 2023, 3:36 a.m. | OK | GNU C++14 | TESTS | 12 | 93 | 3174400 | ||
207697688 | NgVanMinh | B | May 29, 2023, 2:23 a.m. | OK | GNU C++14 | TESTS | 12 | 93 | 4812800 | ||
207707323 | Cujoh_Jolyne | B | May 29, 2023, 3:21 a.m. | OK | GNU C++14 | TESTS | 12 | 93 | 4812800 | ||
207716721 | mandloiji71 | B | May 29, 2023, 5:48 a.m. | OK | GNU C++14 | TESTS | 12 | 93 | 4812800 | ||
207698120 | m99_Tanishq | B | May 29, 2023, 2:32 a.m. | OK | GNU C++14 | TESTS | 12 | 93 | 4812800 | ||
207709456 | gigajet | B | May 29, 2023, 3:56 a.m. | OK | GNU C++17 | TESTS | 12 | 62 | 3174400 | ||
207693974 | rqoi031 | B | May 29, 2023, 12:59 a.m. | OK | GNU C++17 | TESTS | 12 | 62 | 4812800 | ||
207694118 | avnithv | B | May 29, 2023, 1:03 a.m. | OK | GNU C++17 | TESTS | 12 | 78 | 5324800 | ||
207716761 | chomotngayloihuanohoa | B | May 29, 2023, 5:49 a.m. | OK | GNU C++17 | TESTS | 12 | 93 | 1638400 | ||
207676657 | Mhamad_aboaljood | B | May 28, 2023, 6:32 p.m. | OK | GNU C++17 | TESTS | 12 | 93 | 3174400 | ||
207669845 | Zandler | B | May 28, 2023, 5:42 p.m. | OK | GNU C++17 | TESTS | 12 | 93 | 3174400 | ||
207682370 | jajabuu | B | May 28, 2023, 7:45 p.m. | OK | GNU C++17 | TESTS | 12 | 93 | 3174400 | ||
207693860 | AkaiLemon | B | May 29, 2023, 12:55 a.m. | OK | GNU C++17 | TESTS | 12 | 93 | 3174400 | ||
207713713 | whiteflags26 | B | May 29, 2023, 5:05 a.m. | OK | GNU C++17 | TESTS | 12 | 93 | 3174400 | ||
207694219 | TNISL | B | May 29, 2023, 1:06 a.m. | OK | GNU C++17 | TESTS | 12 | 93 | 3993600 | ||
207672476 | sillyMistakes | B | May 28, 2023, 5:57 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 46 | 4812800 | ||
207662906 | kaorin | B | May 28, 2023, 4:53 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 61 | 3174400 | ||
207672063 | Krzychuo | B | May 28, 2023, 5:54 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 3993600 | ||
207669816 | pzsX | B | May 28, 2023, 5:42 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 4812800 | ||
207712593 | Once_I_Liked_AGirl | B | May 29, 2023, 4:49 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 4812800 | ||
207694851 | binglengmo | B | May 29, 2023, 1:22 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 4812800 | ||
207682121 | Mohamed_sa3d | B | May 28, 2023, 7:41 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 4812800 | ||
207674912 | Junaid077 | B | May 28, 2023, 6:17 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 4812800 | ||
207696187 | enslaved | B | May 29, 2023, 1:53 a.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 6451200 | ||
207683433 | HelmOptimum | B | May 28, 2023, 8:02 p.m. | OK | GNU C++17 (64) | TESTS | 12 | 62 | 9625600 | ||
207672975 | dimash1 | B | May 28, 2023, 6:01 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 2355200 | ||
207691940 | Mohannadms | B | May 28, 2023, 11:51 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207681872 | TamimEhsan | B | May 28, 2023, 7:38 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207680562 | joonyou | B | May 28, 2023, 7:20 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207714072 | Kidding__Ma | B | May 29, 2023, 5:10 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207675368 | SharifHossen | B | May 28, 2023, 6:21 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207711752 | LittleDumbGoose | B | May 29, 2023, 4:35 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207694181 | FlameFire | B | May 29, 2023, 1:04 a.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3174400 | ||
207675201 | frozencat | B | May 28, 2023, 6:19 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3993600 | ||
207680442 | joonyou | B | May 28, 2023, 7:18 p.m. | OK | GNU C++20 (64) | TESTS | 12 | 46 | 3993600 | ||
207682486 | igbenko | B | May 28, 2023, 7:47 p.m. | OK | Go | TESTS | 12 | 108 | 24064000 | ||
207678506 | harsh.awasthi | B | May 28, 2023, 6:54 p.m. | OK | Go | TESTS | 12 | 249 | 24166400 | ||
207690484 | InfinitePath | B | May 28, 2023, 10:52 p.m. | OK | Java 11 | TESTS | 12 | 233 | 0 | ||
207677255 | MuhammD_husss | B | May 28, 2023, 6:39 p.m. | OK | Java 11 | TESTS | 12 | 249 | 2457600 | ||
207680199 | MuhammD_husss | B | May 28, 2023, 7:15 p.m. | OK | Java 11 | TESTS | 12 | 265 | 2457600 | ||
207677980 | kasiru_69 | B | May 28, 2023, 6:47 p.m. | OK | Java 11 | TESTS | 12 | 467 | 27852800 | ||
207694395 | biu_biu_biu | B | May 29, 2023, 1:10 a.m. | OK | Java 11 | TESTS | 12 | 966 | 23756800 | ||
207717621 | sumitlaura101 | B | May 29, 2023, 5:59 a.m. | OK | Java 17 | TESTS | 12 | 264 | 7372800 | ||
207714215 | fightingxjz | B | May 29, 2023, 5:12 a.m. | OK | Java 17 | TESTS | 12 | 265 | 2560000 | ||
207674654 | Vrutik_2809 | B | May 28, 2023, 6:14 p.m. | OK | Java 17 | TESTS | 12 | 296 | 15257600 | ||
207707382 | VIVEK_8877 | B | May 29, 2023, 3:21 a.m. | OK | Java 17 | TESTS | 12 | 374 | 31232000 | ||
207716997 | rishabhkumrawat02 | B | May 29, 2023, 5:52 a.m. | OK | Java 17 | TESTS | 12 | 420 | 19558400 | ||
207661413 | bunny06 | B | May 28, 2023, 4:49 p.m. | OK | Java 17 | TESTS | 12 | 514 | 21708800 | ||
207712493 | tusharrai132 | B | May 29, 2023, 4:47 a.m. | OK | Java 17 | TESTS | 12 | 685 | 819200 | ||
207696646 | ranjitbisai48 | B | May 29, 2023, 2:03 a.m. | OK | Java 17 | TESTS | 12 | 904 | 28774400 | ||
207662591 | 2000030570 | B | May 28, 2023, 4:52 p.m. | OK | Java 17 | TESTS | 12 | 982 | 31641600 | ||
207708361 | chuquwan9964 | B | May 29, 2023, 3:38 a.m. | OK | Java 8 | TESTS | 12 | 93 | 0 | ||
207699949 | vamsigv96 | B | May 29, 2023, 3:05 a.m. | OK | Java 8 | TESTS | 12 | 155 | 6656000 | ||
207688941 | NerfThis | B | May 28, 2023, 10:01 p.m. | OK | Java 8 | TESTS | 12 | 155 | 7065600 | ||
207707220 | bleach__ | B | May 29, 2023, 3:19 a.m. | OK | Java 8 | TESTS | 12 | 218 | 16896000 | ||
207693145 | Autunomy | B | May 29, 2023, 12:34 a.m. | OK | Java 8 | TESTS | 12 | 249 | 7577600 | ||
207672997 | weird_penguin | B | May 28, 2023, 6:01 p.m. | OK | Java 8 | TESTS | 12 | 311 | 17305600 | ||
207690430 | mohamedhassan_c | B | May 28, 2023, 10:50 p.m. | OK | Java 8 | TESTS | 12 | 311 | 43622400 | ||
207712685 | Deependra_coder | B | May 29, 2023, 4:50 a.m. | OK | Java 8 | TESTS | 12 | 342 | 21913600 | ||
207693124 | Autunomy | B | May 29, 2023, 12:33 a.m. | OK | Java 8 | TESTS | 12 | 342 | 21913600 | ||
207713082 | altynbek.nurgaziyev | B | May 29, 2023, 4:56 a.m. | OK | Java 8 | TESTS | 12 | 374 | 13926400 | ||
207685374 | _vanger_ | B | May 28, 2023, 8:35 p.m. | OK | MS C++ 2017 | TESTS | 12 | 312 | 3174400 | ||
207685800 | _vanger_ | B | May 28, 2023, 8:43 p.m. | OK | MS C++ 2017 | TESTS | 12 | 327 | 3174400 | ||
207661524 | JRose1121 | B | May 28, 2023, 4:49 p.m. | OK | MS C++ 2017 | TESTS | 12 | 343 | 8192000 | ||
207696851 | Eternalisgaming | B | May 29, 2023, 2:08 a.m. | OK | MS C++ 2017 | TESTS | 12 | 358 | 4812800 | ||
207665908 | CommonMan22 | B | May 28, 2023, 5:01 p.m. | OK | MS C++ 2017 | TESTS | 12 | 436 | 18124800 | ||
207662831 | EbuYandex | B | May 28, 2023, 4:53 p.m. | OK | MS C++ 2017 | TESTS | 12 | 576 | 15872000 | ||
207679663 | EbuYandex | B | May 28, 2023, 7:08 p.m. | OK | MS C++ 2017 | TESTS | 12 | 608 | 15872000 | ||
207673642 | rasheed_ashen_one | B | May 28, 2023, 6:06 p.m. | OK | PyPy 3 | TESTS | 12 | 483 | 35840000 | ||
207681293 | rasheed_ashen_one | B | May 28, 2023, 7:30 p.m. | OK | PyPy 3 | TESTS | 12 | 498 | 21913600 | ||
207680611 | rasheed_ashen_one | B | May 28, 2023, 7:21 p.m. | OK | PyPy 3 | TESTS | 12 | 498 | 27033600 | ||
207687509 | coolavy999 | B | May 28, 2023, 9:20 p.m. | OK | PyPy 3 | TESTS | 12 | 514 | 18022400 | ||
207681110 | rasheed_ashen_one | B | May 28, 2023, 7:27 p.m. | OK | PyPy 3 | TESTS | 12 | 514 | 21401600 | ||
207677289 | rasheed_ashen_one | B | May 28, 2023, 6:39 p.m. | OK | PyPy 3 | TESTS | 12 | 514 | 30003200 | ||
207678089 | rasheed_ashen_one | B | May 28, 2023, 6:49 p.m. | OK | PyPy 3 | TESTS | 12 | 529 | 30822400 | ||
207688987 | andy0liang | B | May 28, 2023, 10:03 p.m. | OK | PyPy 3 | TESTS | 12 | 530 | 30515200 | ||
207680687 | rasheed_ashen_one | B | May 28, 2023, 7:22 p.m. | OK | PyPy 3 | TESTS | 12 | 560 | 25292800 | ||
207690099 | w313880557 | B | May 28, 2023, 10:39 p.m. | OK | PyPy 3 | TESTS | 12 | 577 | 20377600 | ||
207675799 | gardengnome | B | May 28, 2023, 6:24 p.m. | OK | PyPy 3-64 | TESTS | 12 | 186 | 31232000 | ||
207716057 | kwin | B | May 29, 2023, 5:39 a.m. | OK | PyPy 3-64 | TESTS | 12 | 186 | 36249600 | ||
207669856 | dipakgupta007 | B | May 28, 2023, 5:42 p.m. | OK | PyPy 3-64 | TESTS | 12 | 202 | 37478400 | ||
207679345 | bilalboualam63 | B | May 28, 2023, 7:04 p.m. | OK | PyPy 3-64 | TESTS | 12 | 218 | 16076800 | ||
207716843 | Little_Sheep_Yawn | B | May 29, 2023, 5:50 a.m. | OK | PyPy 3-64 | TESTS | 12 | 233 | 48947200 | ||
207691345 | Quick-One | B | May 28, 2023, 11:27 p.m. | OK | PyPy 3-64 | TESTS | 12 | 249 | 39219200 | ||
207675247 | Kladrr | B | May 28, 2023, 6:20 p.m. | OK | PyPy 3-64 | TESTS | 12 | 264 | 32563200 | ||
207715021 | BlackSpectre | B | May 29, 2023, 5:25 a.m. | OK | PyPy 3-64 | TESTS | 12 | 264 | 32870400 | ||
207686780 | anshumannandan | B | May 28, 2023, 9:02 p.m. | OK | PyPy 3-64 | TESTS | 12 | 264 | 34713600 | ||
207717213 | flexr | B | May 29, 2023, 5:55 a.m. | OK | PyPy 3-64 | TESTS | 12 | 265 | 27648000 | ||
207659344 | Mr.Backender | B | May 28, 2023, 4:44 p.m. | OK | Python 3 | TESTS | 12 | 420 | 40550400 | ||
207676270 | saini.laxman2002 | B | May 28, 2023, 6:29 p.m. | OK | Python 3 | TESTS | 12 | 467 | 40960000 | ||
207672604 | Block_Cipher | B | May 28, 2023, 5:58 p.m. | OK | Python 3 | TESTS | 12 | 483 | 26624000 | ||
207688057 | Cp_dead | B | May 28, 2023, 9:35 p.m. | OK | Python 3 | TESTS | 12 | 498 | 34508800 | ||
207670914 | Shalin_06 | B | May 28, 2023, 5:48 p.m. | OK | Python 3 | TESTS | 12 | 530 | 35123200 | ||
207662584 | 30118_Sunayana | B | May 28, 2023, 4:52 p.m. | OK | Python 3 | TESTS | 12 | 545 | 35123200 | ||
207707234 | eugalt | B | May 29, 2023, 3:19 a.m. | OK | Python 3 | TESTS | 12 | 545 | 78643200 | ||
207665408 | Ankit_1703 | B | May 28, 2023, 4:59 p.m. | OK | Python 3 | TESTS | 12 | 560 | 35123200 | ||
207667991 | durgaprasad29140 | B | May 28, 2023, 5:04 p.m. | OK | Python 3 | TESTS | 12 | 561 | 34201600 | ||
207661758 | vtu17171 | B | May 28, 2023, 4:50 p.m. | OK | Python 3 | TESTS | 12 | 561 | 46182400 | ||
207679156 | 0npata | B | May 28, 2023, 7:02 p.m. | OK | Rust 2021 | TESTS | 12 | 46 | 6451200 | ||
207676301 | A_G | B | May 28, 2023, 6:29 p.m. | OK | Rust 2021 | TESTS | 12 | 62 | 26931200 | ||
207672937 | ilyshana | B | May 28, 2023, 6 p.m. | OK | Rust 2021 | TESTS | 12 | 78 | 11673600 | ||
207663375 | broWtF | B | May 28, 2023, 4:54 p.m. | OK | Rust 2021 | TESTS | 12 | 139 | 11571200 | ||
207715640 | jinmatakich84 | B | May 29, 2023, 5:34 a.m. | OK | Rust 2021 | TESTS | 12 | 155 | 15872000 |
Back to search problems