Codeforces Round 906 (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
1889 Codeforces Round 906 (Div. 1) FINISHED False 9000 38676263 Oct. 28, 2023, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 3411 ) C1 Doremy's Drying Plan (Easy Version) PROGRAMMING brute force data structures dp greedy sortings

B'The only differences between the two versions of this problem are the constraint on k , the time limit and the memory limit. You can make hacks only if all versions of the problem are solved. Doremy lives in a rainy country consisting of n cities numbered from 1 to n . The weather broadcast predicted the distribution of rain in the next m days. In the i -th day, it will rain in the cities in the interval [l_i, r_i] . A city is called dry if it will never rain in that city in the next m days. It turns out that Doremy has a special power. She can choose k days (in the easy version, k = 2 ), and during these days it will not rain. Doremy wants to calculate the maximum number of dry cities after using the special power. The input consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 10^4 ) -- the number of test cases. The description of the test cases follows. The first line contains three integers n , m and k ( 1 <= n <= 2 cdot 10^5 , 2 <= m <= 2 cdot 10^5 , k = 2 ) -- the number of cities, the number of days, and the number of days of rain that Doremy can prevent. Then, m lines follow. The i -th line contains two integers l_i , r_i ( 1 <= l_i <= r_i <= n ) -- the rain coverage on day i . It is guaranteed that the sum of n and the sum of m over all test cases do not exceed 2 cdot 10^5 . For each test case, output one integer -- the maximum number of dry cities. In the first test case, if Doremy prevents So there is at most 1 dry city. In the second test case, if Doremy prevents So there are at most 2 dry cities. In the third test case, it is optimal to prevent rain 2,5 . In the forth test case, there is always 4 days of rain that wets all the cities and cannot be prevented. '...

Tutorials

Codeforces Round 906 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
230247597 mban259 C1 Oct. 28, 2023, 4:25 p.m. OK C# 10 TESTS 71 389 62566400
230226786 KumaTachiRen C1 Oct. 28, 2023, 3:38 p.m. OK C# 8 TESTS 71 233 32665600
230258341 Gassa C1 Oct. 28, 2023, 4:53 p.m. OK D TESTS 71 576 38604800
230234524 chro4896 C1 Oct. 28, 2023, 3:54 p.m. OK GNU C11 TESTS 71 171 6860800
230298734 hzt1 C1 Oct. 29, 2023, 1:13 a.m. OK GNU C++14 TESTS 71 109 1945600
230299771 hzt1 C1 Oct. 29, 2023, 1:42 a.m. OK GNU C++14 TESTS 71 109 1945600
230299962 hzt1 C1 Oct. 29, 2023, 1:47 a.m. OK GNU C++14 TESTS 71 124 1945600
230300648 ForwardStar C1 Oct. 29, 2023, 2:03 a.m. OK GNU C++14 TESTS 71 124 7987200
230244214 Mapakaka C1 Oct. 28, 2023, 4:16 p.m. OK GNU C++14 TESTS 71 140 5632000
230242259 cfhj C1 Oct. 28, 2023, 4:11 p.m. OK GNU C++14 TESTS 71 156 8806400
230255256 Leasier C1 Oct. 28, 2023, 4:45 p.m. OK GNU C++14 TESTS 71 156 39936000
230298123 RobertoFirmino C1 Oct. 29, 2023, 12:55 a.m. OK GNU C++14 TESTS 71 186 8806400
230266102 robertofirmino09 C1 Oct. 28, 2023, 5:37 p.m. OK GNU C++14 TESTS 71 187 8806400
230269254 clfzs C1 Oct. 28, 2023, 5:53 p.m. OK GNU C++14 TESTS 71 218 50483200
230212911 Nson C1 Oct. 28, 2023, 3:14 p.m. OK GNU C++17 TESTS 71 124 6451200
230231896 FelixMP C1 Oct. 28, 2023, 3:49 p.m. OK GNU C++17 TESTS 71 155 6451200
230296809 Staszek C1 Oct. 29, 2023, 12:05 a.m. OK GNU C++17 TESTS 71 171 19353600
230240591 Andyvanh1 C1 Oct. 28, 2023, 4:08 p.m. OK GNU C++17 TESTS 71 171 19763200
230306490 kookeudas C1 Oct. 29, 2023, 3:47 a.m. OK GNU C++17 TESTS 71 187 11161600
230226290 miss_robot C1 Oct. 28, 2023, 3:37 p.m. OK GNU C++17 TESTS 71 202 13004800
230244918 buihoatchuyenhv C1 Oct. 28, 2023, 4:18 p.m. OK GNU C++17 TESTS 71 233 10342400
230285940 Intellegent C1 Oct. 28, 2023, 8:19 p.m. OK GNU C++17 TESTS 71 233 12800000
230249876 jjaworska C1 Oct. 28, 2023, 4:31 p.m. OK GNU C++17 TESTS 71 233 18841600
230255847 coriander C1 Oct. 28, 2023, 4:47 p.m. OK GNU C++17 TESTS 71 234 13619200
230248153 lostintianyi C1 Oct. 28, 2023, 4:26 p.m. OK GNU C++17 (64) TESTS 71 140 8806400
230230022 SyruLoveNewTechnology C1 Oct. 28, 2023, 3:45 p.m. OK GNU C++17 (64) TESTS 71 155 12083200
230233325 icecuber C1 Oct. 28, 2023, 3:51 p.m. OK GNU C++17 (64) TESTS 71 155 13107200
230248125 akua C1 Oct. 28, 2023, 4:26 p.m. OK GNU C++17 (64) TESTS 71 156 27136000
230220534 PEKKA_l C1 Oct. 28, 2023, 3:27 p.m. OK GNU C++17 (64) TESTS 71 171 46489600
230216724 kotatsugame C1 Oct. 28, 2023, 3:20 p.m. OK GNU C++17 (64) TESTS 71 187 25292800
230239463 stkwill C1 Oct. 28, 2023, 4:05 p.m. OK GNU C++17 (64) TESTS 71 218 30208000
230243515 EmeraldBlock C1 Oct. 28, 2023, 4:14 p.m. OK GNU C++17 (64) TESTS 71 234 18534400
230222696 K-H C1 Oct. 28, 2023, 3:31 p.m. OK GNU C++17 (64) TESTS 71 249 11571200
230207213 Crystally C1 Oct. 28, 2023, 3:05 p.m. OK GNU C++17 (64) TESTS 71 249 49049600
230236717 JYJin C1 Oct. 28, 2023, 3:59 p.m. OK GNU C++20 (64) TESTS 71 93 6144000
230266613 Kaibad C1 Oct. 28, 2023, 5:39 p.m. OK GNU C++20 (64) TESTS 71 93 14438400
230241371 wzihan C1 Oct. 28, 2023, 4:09 p.m. OK GNU C++20 (64) TESTS 71 109 14745600
230231764 minhcool C1 Oct. 28, 2023, 3:48 p.m. OK GNU C++20 (64) TESTS 71 109 37580800
230245143 i8d C1 Oct. 28, 2023, 4:19 p.m. OK GNU C++20 (64) TESTS 71 124 3174400
230225393 METHOD_METAFALICA C1 Oct. 28, 2023, 3:35 p.m. OK GNU C++20 (64) TESTS 71 124 19660800
230279688 Jasonwei08 C1 Oct. 28, 2023, 7:12 p.m. OK GNU C++20 (64) TESTS 71 124 27238400
230242381 Kai-HavertZ C1 Oct. 28, 2023, 4:12 p.m. OK GNU C++20 (64) TESTS 71 124 80179200
230245561 Endagorion C1 Oct. 28, 2023, 4:20 p.m. OK GNU C++20 (64) TESTS 71 139 26828800
230223226 20333333333 C1 Oct. 28, 2023, 3:31 p.m. OK GNU C++20 (64) TESTS 71 139 27852800
230228651 profchi C1 Oct. 28, 2023, 3:42 p.m. OK Java 11 TESTS 71 514 15462400
230248657 TCchen C1 Oct. 28, 2023, 4:27 p.m. OK Java 11 TESTS 71 904 18432000
230289708 golions C1 Oct. 28, 2023, 9:08 p.m. OK Java 8 TESTS 71 686 77209600
230261949 SecondThread C1 Oct. 28, 2023, 5:02 p.m. OK Java 8 TESTS 71 966 121344000
230228888 Tlatoani C1 Oct. 28, 2023, 3:42 p.m. OK Kotlin 1.6 TESTS 71 732 7884800
230244309 FastFreeTask C1 Oct. 28, 2023, 4:16 p.m. OK Kotlin 1.6 TESTS 71 998 97484800
230250310 plevande C1 Oct. 28, 2023, 4:32 p.m. OK PyPy 3-64 TESTS 71 638 77619200
230237466 tamato C1 Oct. 28, 2023, 4:01 p.m. OK PyPy 3-64 TESTS 71 748 93798400
230239144 titia C1 Oct. 28, 2023, 4:04 p.m. OK PyPy 3-64 TESTS 71 810 108441600
230273767 Alex239 C1 Oct. 28, 2023, 6:23 p.m. OK PyPy 3-64 TESTS 71 888 40857600
230219583 whatshisbucket C1 Oct. 28, 2023, 3:25 p.m. OK PyPy 3-64 TESTS 71 935 108339200
230229948 dyppp C1 Oct. 28, 2023, 3:45 p.m. OK PyPy 3-64 TESTS 71 951 125337600
230222614 jatloe C1 Oct. 28, 2023, 3:30 p.m. OK PyPy 3-64 TESTS 71 998 142540800
230220709 sansen C1 Oct. 28, 2023, 3:27 p.m. OK Rust 2021 TESTS 71 405 36454400
230250579 WaterColor2037 C1 Oct. 28, 2023, 4:33 p.m. OK Rust 2021 TESTS 71 483 79155200

remove filters

Back to search problems