Codeforces Round 905 (Div. 3)

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
1883 Codeforces Round 905 (Div. 3) FINISHED False 7200 39207263 Oct. 22, 2023, 11:05 a.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 5616 ) G2 Dances (Hard Version) PROGRAMMING binary search

B'This is the hard version of the problem. The only difference is that in this version m <= q 10^9 . You are given two arrays of integers a_1, a_2, ldots, a_n and b_1, b_2, ldots, b_n . Before applying any operations, you can reorder the elements of each array as you wish. Then, in one operation, you will perform both of the following actions, if the arrays are not empty: Let k be the final size of both arrays. You need to find the minimum number of operations required to satisfy a_i < b_i for all 1 <= q i <= q k . This problem was too easy, so the problem author decided to make it more challenging. You are also given a positive integer m . Now, you need to find the sum of answers to the problem for m pairs of arrays (c[i], b) , where 1 <= q i <= q m . Array c[i] is obtained from a as follows: Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= q t <= q 10^4 ) - the number of sets of input data. This is followed by their description. The first line of each test case contains two integers n and m ( 2 <= q n <= q 10^5 , 1 <= q m <= q 10^9 ) - the size of arrays a and b and the constraints on the value of element a_1 . The second line of each test case contains n - 1 integers a_2, ldots, a_n ( 1 <= q a_i <= q 10^9 ). The third line of each test case contains n integers b_1, b_2, ldots, b_n ( 1 <= q b_i <= q 10^9 ). It is guaranteed that the sum of n over all test cases does not exceed 10^5 . For each test case, output the total number of minimum operations for all pairs of arrays (c_i, b) . In the first test case: '...

Tutorials

Codeforces Round #905 (Div. 1, Div. 2, Div. 3) Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
229374570 Cu_OH_2 G2 Oct. 23, 2023, 6:02 a.m. OK GNU C++14 TESTS 15 62 819200
229361955 cannotdp G2 Oct. 23, 2023, 2:48 a.m. OK GNU C++14 TESTS 15 78 1228800
229289245 Estelle. G2 Oct. 22, 2023, 1:04 p.m. OK GNU C++14 TESTS 15 78 1228800
229306406 xuantianhao G2 Oct. 22, 2023, 3:07 p.m. OK GNU C++14 TESTS 15 78 2457600
229371418 pring G2 Oct. 23, 2023, 5:27 a.m. OK GNU C++14 TESTS 15 93 2457600
229330144 OKsami G2 Oct. 22, 2023, 6:29 p.m. OK GNU C++14 TESTS 15 108 4198400
229362095 Duchunyang G2 Oct. 23, 2023, 2:51 a.m. OK GNU C++14 TESTS 15 109 819200
229331309 Q.Kasparov G2 Oct. 22, 2023, 6:40 p.m. OK GNU C++14 TESTS 15 109 5017600
229359137 guoshujin20090423 G2 Oct. 23, 2023, 1:50 a.m. OK GNU C++14 TESTS 15 109 36044800
229304314 kira98k G2 Oct. 22, 2023, 2:51 p.m. OK GNU C++14 TESTS 15 124 1638400
229335352 gaurav_accepted G2 Oct. 22, 2023, 7:22 p.m. OK GNU C++17 TESTS 15 78 819200
229361509 D_Z_W G2 Oct. 23, 2023, 2:39 a.m. OK GNU C++17 TESTS 15 78 1228800
229327052 Harshit_Singh G2 Oct. 22, 2023, 6:02 p.m. OK GNU C++17 TESTS 15 78 1228800
229318920 newestsolego G2 Oct. 22, 2023, 4:50 p.m. OK GNU C++17 TESTS 15 78 1228800
229340901 kapishv G2 Oct. 22, 2023, 8:25 p.m. OK GNU C++17 TESTS 15 93 819200
229326813 Harshit_Singh G2 Oct. 22, 2023, 6 p.m. OK GNU C++17 TESTS 15 93 1228800
229374273 doneandonly21 G2 Oct. 23, 2023, 5:59 a.m. OK GNU C++17 TESTS 15 93 6348800
229292975 Vanjanja G2 Oct. 22, 2023, 1:49 p.m. OK GNU C++17 TESTS 15 93 6860800
229362679 Kai_benefit G2 Oct. 23, 2023, 3:02 a.m. OK GNU C++17 TESTS 15 109 921600
229364473 sunj G2 Oct. 23, 2023, 3:34 a.m. OK GNU C++17 TESTS 15 109 3481600
229355711 Xiomara_YiJie G2 Oct. 23, 2023, 12:22 a.m. OK GNU C++17 (64) TESTS 15 62 6963200
229327301 Liudas G2 Oct. 22, 2023, 6:04 p.m. OK GNU C++17 (64) TESTS 15 78 5734400
229358802 xioachou G2 Oct. 23, 2023, 1:44 a.m. OK GNU C++17 (64) TESTS 15 93 5632000
229323983 MUNISJONI_KHURSHEDJON G2 Oct. 22, 2023, 5:35 p.m. OK GNU C++17 (64) TESTS 15 93 6451200
229322298 LimboBoom G2 Oct. 22, 2023, 5:20 p.m. OK GNU C++17 (64) TESTS 15 93 6451200
229354470 chappy1 G2 Oct. 22, 2023, 11:41 p.m. OK GNU C++17 (64) TESTS 15 171 1228800
229311815 Klinashka G2 Oct. 22, 2023, 3:50 p.m. OK GNU C++17 (64) TESTS 15 390 1638400
229299460 Mkbk_program_learn G2 Oct. 22, 2023, 2:20 p.m. OK GNU C++17 (64) TESTS 15 1513 17100800
229369169 lazyx_zZ G2 Oct. 23, 2023, 4:56 a.m. OK GNU C++20 (64) TESTS 15 46 819200
229351317 Ahmed_Solyman G2 Oct. 22, 2023, 10:07 p.m. OK GNU C++20 (64) TESTS 15 46 819200
229350572 abdrahmanabdkareem G2 Oct. 22, 2023, 9:49 p.m. OK GNU C++20 (64) TESTS 15 46 819200
229319827 kirillveshnyakov G2 Oct. 22, 2023, 4:58 p.m. OK GNU C++20 (64) TESTS 15 46 1638400
229317287 maspy G2 Oct. 22, 2023, 4:36 p.m. OK GNU C++20 (64) TESTS 15 46 1638400
229308947 hhg G2 Oct. 22, 2023, 3:27 p.m. OK GNU C++20 (64) TESTS 15 46 1638400
229301119 yyytf__ G2 Oct. 22, 2023, 2:30 p.m. OK GNU C++20 (64) TESTS 15 46 1638400
229295137 messi30 G2 Oct. 22, 2023, 1:57 p.m. OK GNU C++20 (64) TESTS 15 46 1638400
229372823 PCC G2 Oct. 23, 2023, 5:43 a.m. OK GNU C++20 (64) TESTS 15 46 2355200
229312628 pora G2 Oct. 22, 2023, 3:57 p.m. OK GNU C++20 (64) TESTS 15 46 2969600
229286924 GR1ZLER G2 Oct. 22, 2023, 1:02 p.m. OK Java 11 TESTS 15 342 4915200
229369211 utsav_deep G2 Oct. 23, 2023, 4:56 a.m. OK Java 11 TESTS 15 514 51712000
229366484 cpp10 G2 Oct. 23, 2023, 4:11 a.m. OK Java 17 TESTS 15 280 1228800
229366593 cpp10 G2 Oct. 23, 2023, 4:13 a.m. OK Java 17 TESTS 15 280 1638400
229364345 dzhi G2 Oct. 23, 2023, 3:32 a.m. OK Java 17 TESTS 15 295 1433600
229364124 dzhi G2 Oct. 23, 2023, 3:28 a.m. OK Java 17 TESTS 15 311 1740800
229321402 1091857051 G2 Oct. 22, 2023, 5:12 p.m. OK Java 8 TESTS 15 170 1228800
229328083 formidablechief_27 G2 Oct. 22, 2023, 6:11 p.m. OK Java 8 TESTS 15 342 9932800
229361271 mikeac G2 Oct. 23, 2023, 2:34 a.m. OK PyPy 3-64 TESTS 15 187 16691200
229342992 lionel.m G2 Oct. 22, 2023, 8:53 p.m. OK PyPy 3-64 TESTS 15 577 19148800
229309089 hunglomdom G2 Oct. 22, 2023, 3:28 p.m. OK PyPy 3-64 TESTS 15 701 22323200
229318329 silvertint10 G2 Oct. 22, 2023, 4:45 p.m. OK PyPy 3-64 TESTS 15 732 19148800
229326989 kz2d G2 Oct. 22, 2023, 6:02 p.m. OK Rust 2021 TESTS 15 436 5017600

remove filters

Back to search problems