Codeforces Round 908 (Div. 1)

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
1893 Codeforces Round 908 (Div. 1) FINISHED False 7200 32455499 Nov. 7, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 9015 ) B Neutral Tonality PROGRAMMING constructive algorithms greedy sortings two pointers

B'You are given an array a consisting of n integers, as well as an array b consisting of m integers. Let text{LIS}(c) denote the length of the longest increasing subsequence of array c . For example, text{LIS}([2, underline{1}, 1, underline{3}]) = 2 , text{LIS}([ underline{1}, underline{7}, underline{9}]) = 3 , text{LIS}([3, underline{1}, underline{2}, underline{4}]) = 3 . You need to insert the numbers b_1, b_2, ldots, b_m into the array a , at any positions, in any order. Let the resulting array be c_1, c_2, ldots, c_{n+m} . You need to choose the positions for insertion in order to minimize text{LIS}(c) . Formally, you need to find an array c_1, c_2, ldots, c_{n+m} that simultaneously satisfies the following conditions: Each test contains multiple test cases. The first line contains a single integer t (1 <= q t <= q 10^4) -- the number of test cases. The description of the test cases follows. The first line of each test case contains two integers n, m (1 <= q n <= q 2 cdot 10^5, 1 <= q m <= q 2 cdot 10^5) -- the length of array a and the length of array b . 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 . The third line of each test case contains m integers b_1, b_2, ldots, b_m (1 <= q b_i <= q 10^9) -- the elements of the array b . It is guaranteed that the sum of n over all test cases does not exceed 2 cdot 10^5 , and the sum of m over all test cases does not exceed 2 cdot 10^5 . For each test case, output n + m numbers -- the elements of the final array c_1, c_2, ldots, c_{n+m} , obtained after the insertion, such that the value of text{LIS}(c) is minimized. If there are several answers, you can output any of them. In the first te'...

Tutorials

Codeforces Round 908 (Div. 1, Div, 2) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
231785182 KumaTachiRen B Nov. 7, 2023, 4:01 p.m. OK C# 8 TESTS 18 218 29798400
231757601 Gassa B Nov. 7, 2023, 3 p.m. OK D TESTS 18 389 29798400
231754891 hos.lyric B Nov. 7, 2023, 2:55 p.m. OK D TESTS 18 654 44339200
231843012 rainboy B Nov. 7, 2023, 7 p.m. OK GNU C11 TESTS 18 1918 1638400
231750298 Muelsyse B Nov. 7, 2023, 2:47 p.m. OK GNU C++14 TESTS 18 218 1638400
231752299 StarSilk B Nov. 7, 2023, 2:50 p.m. OK GNU C++14 TESTS 18 218 1638400
231777252 squaredog B Nov. 7, 2023, 3:40 p.m. OK GNU C++14 TESTS 18 218 3174400
231835748 Ron_Chen B Nov. 7, 2023, 6:10 p.m. OK GNU C++14 TESTS 18 218 3993600
231769135 cxaphoenix B Nov. 7, 2023, 3:22 p.m. OK GNU C++14 TESTS 18 233 1740800
231771176 MCPlayer542 B Nov. 7, 2023, 3:26 p.m. OK GNU C++14 TESTS 18 233 2355200
231772084 FudNyh B Nov. 7, 2023, 3:28 p.m. OK GNU C++14 TESTS 18 233 3174400
231754961 awoo B Nov. 7, 2023, 2:55 p.m. OK GNU C++14 TESTS 18 233 4812800
231773563 markitos B Nov. 7, 2023, 3:32 p.m. OK GNU C++14 TESTS 18 233 5632000
231760722 hzt1 B Nov. 7, 2023, 3:05 p.m. OK GNU C++14 TESTS 18 233 6451200
231755104 KroosTheKeenGlint B Nov. 7, 2023, 2:56 p.m. OK GNU C++17 TESTS 18 202 2457600
231885122 saltyy B Nov. 8, 2023, 5:04 a.m. OK GNU C++17 TESTS 18 217 1638400
231763374 houzhe B Nov. 7, 2023, 3:10 p.m. OK GNU C++17 TESTS 18 217 3174400
231884091 fengyecong B Nov. 8, 2023, 4:48 a.m. OK GNU C++17 TESTS 18 218 1638400
231860929 ojas_2003 B Nov. 7, 2023, 9:13 p.m. OK GNU C++17 TESTS 18 218 1638400
231767579 Ant_Man B Nov. 7, 2023, 3:19 p.m. OK GNU C++17 TESTS 18 218 1638400
231887491 15owzLy1 B Nov. 8, 2023, 5:36 a.m. OK GNU C++17 TESTS 18 218 1638400
231759747 TadijaSebez B Nov. 7, 2023, 3:03 p.m. OK GNU C++17 TESTS 18 218 1740800
231762606 Shuishui_0921 B Nov. 7, 2023, 3:09 p.m. OK GNU C++17 TESTS 18 218 2457600
231830338 isagi B Nov. 7, 2023, 5:27 p.m. OK GNU C++17 TESTS 18 218 3174400
231753727 ITworker_Z B Nov. 7, 2023, 2:53 p.m. OK GNU C++17 (64) TESTS 18 62 10035200
231772500 drdilyor B Nov. 7, 2023, 3:29 p.m. OK GNU C++17 (64) TESTS 18 155 3379200
231751594 ethening B Nov. 7, 2023, 2:49 p.m. OK GNU C++17 (64) TESTS 18 155 5836800
231886600 wangjunchao B Nov. 8, 2023, 5:24 a.m. OK GNU C++17 (64) TESTS 18 155 8601600
231774824 Kallen B Nov. 7, 2023, 3:35 p.m. OK GNU C++17 (64) TESTS 18 156 2457600
231831010 supine B Nov. 7, 2023, 5:31 p.m. OK GNU C++17 (64) TESTS 18 156 3788800
231865366 Omar_Mahfouz B Nov. 7, 2023, 10:47 p.m. OK GNU C++17 (64) TESTS 18 156 6451200
231765725 rniya B Nov. 7, 2023, 3:15 p.m. OK GNU C++17 (64) TESTS 18 170 6656000
231764558 GoatTamer B Nov. 7, 2023, 3:12 p.m. OK GNU C++17 (64) TESTS 18 170 12185600
231762985 2077nirundong B Nov. 7, 2023, 3:10 p.m. OK GNU C++17 (64) TESTS 18 171 1638400
231882271 neal B Nov. 8, 2023, 4:20 a.m. OK GNU C++20 (64) TESTS 18 46 2457600
231882149 neal B Nov. 8, 2023, 4:18 a.m. OK GNU C++20 (64) TESTS 18 61 1638400
231759333 Sulfox B Nov. 7, 2023, 3:03 p.m. OK GNU C++20 (64) TESTS 18 62 9011200
231750927 5sb B Nov. 7, 2023, 2:48 p.m. OK GNU C++20 (64) TESTS 18 78 3686400
231762333 notQueue B Nov. 7, 2023, 3:08 p.m. OK GNU C++20 (64) TESTS 18 109 1638400
231845388 Alequisk B Nov. 7, 2023, 7:19 p.m. OK GNU C++20 (64) TESTS 18 109 1638400
231874594 kaztaev B Nov. 8, 2023, 2:23 a.m. OK GNU C++20 (64) TESTS 18 109 1638400
231871437 Anniello B Nov. 8, 2023, 1:21 a.m. OK GNU C++20 (64) TESTS 18 109 1638400
231871192 ClHg2 B Nov. 8, 2023, 1:16 a.m. OK GNU C++20 (64) TESTS 18 109 1638400
231827273 Gondozu B Nov. 7, 2023, 5:09 p.m. OK GNU C++20 (64) TESTS 18 109 1638400
231764082 HugeHobbit B Nov. 7, 2023, 3:12 p.m. OK Java 11 TESTS 18 545 11264000
231780593 frey4 B Nov. 7, 2023, 3:49 p.m. OK Java 21 TESTS 18 748 21708800
231767133 yvbf B Nov. 7, 2023, 3:18 p.m. OK Java 8 TESTS 18 249 0
231760176 golions B Nov. 7, 2023, 3:04 p.m. OK Java 8 TESTS 18 468 28876800
231758121 misorin B Nov. 7, 2023, 3:01 p.m. OK PyPy 3 TESTS 18 624 51404800
231765452 xxh1999 B Nov. 7, 2023, 3:14 p.m. OK PyPy 3-64 TESTS 18 296 61644800
231759599 codicon B Nov. 7, 2023, 3:03 p.m. OK PyPy 3-64 TESTS 18 311 40140800
231772390 Alex239 B Nov. 7, 2023, 3:29 p.m. OK PyPy 3-64 TESTS 18 311 40345600
231762108 eepsilon B Nov. 7, 2023, 3:08 p.m. OK PyPy 3-64 TESTS 18 312 35020800
231881509 cybsbbb B Nov. 8, 2023, 4:10 a.m. OK PyPy 3-64 TESTS 18 327 37888000
231827553 alexwice B Nov. 7, 2023, 5:11 p.m. OK PyPy 3-64 TESTS 18 342 38912000
231765920 jimini23kjm B Nov. 7, 2023, 3:16 p.m. OK PyPy 3-64 TESTS 18 358 40345600
231760298 shade34 B Nov. 7, 2023, 3:04 p.m. OK PyPy 3-64 TESTS 18 467 37683200
231770634 chinerist B Nov. 7, 2023, 3:25 p.m. OK PyPy 3-64 TESTS 18 467 41164800
231773889 hxu10 B Nov. 7, 2023, 3:32 p.m. OK PyPy 3-64 TESTS 18 499 68812800
231875946 venuprogrammer01 B Nov. 8, 2023, 2:45 a.m. OK Python 3 TESTS 18 686 36454400
231757284 Egor B Nov. 7, 2023, 2:59 p.m. OK Rust 2021 TESTS 18 78 5734400
231767417 ngtkana B Nov. 7, 2023, 3:18 p.m. OK Rust 2021 TESTS 18 171 48435200

remove filters

Back to search problems