Codeforces Round 857 (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
1801 Codeforces Round 857 (Div. 1) FINISHED False 10800 98051123 March 9, 2023, 9:35 a.m.

Problems

Solved
Index
Name
Type
Tags
Community Tag
Rating
( 4086 ) C Music Festival PROGRAMMING binary search data structures dp greedy sortings

Vitya has a friend Masha, whom he really wants to invite to the festival, where his favorite bands perform. However, in order for a friend to agree, she must first evaluate the released novelties. Vitya knows that if Masha listens to a track that was cooler than all the previous ones, she will get 1 unit of impression. Unfortunately, albums can only be listened to in their entirety, without changing the songs in them in places. Help Vitya find such an order of albums so that Masha's impression turns out to be as much as possible, and she definitely went to the festival with him. Each test consists of multiple test cases. The first line contains a single integer t ( 1 <= t <= 200 ,000 ) -- 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 <= 200 ,000 ) -- number of albums. The album descriptions follow. Each album description consists of two lines: The first line contains a single integer k_i ( 1 <= k_i <= 200 ,000 ) -- the number of tracks in the i th album. The following line contains k_i integers a_{i, 1}, a_{i, 2}, a_{i, 3}, ldots, a_{i, k_i} ( 1 <= a_{i,j} <= 200 ,000 ) -- the coolness of the tracks in the i album. Denote for sum k_i the sum of all k_i . It is guaranteed that sum k_i <= 200 ,000 . For each test case print the singular number -- the maximum impression that Masha can get. In the first test example, the optimal order is listening to the 4th, 2nd, 3rd and 1st albums. In this case, Masha will listen to the tracks in the following order: 1; 7; 8, 6; 4, 9, 4, 6, 8 and will receive 4 units of impression. In the second test example, you must first listen to the 1st, then the 4th, and in any order the 2nd and 3rd. In this case, Masha will get the maximum impression, and for every song in the 1st and 4th albums and nothing for the 2nd and 3rd.

Tutorials

Codeforces Round #857 Editorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
196623264 mban259 C March 9, 2023, 10:42 a.m. OK C# 10 TESTS 32 452 52736000
196664365 hos.lyric C March 9, 2023, 1:44 p.m. OK D TESTS 32 733 38502400
196623945 High_Score C March 9, 2023, 10:44 a.m. OK GNU C++14 TESTS 32 62 9216000
196667644 rqoi031 C March 9, 2023, 2:01 p.m. OK GNU C++14 TESTS 32 124 3993600
196629057 Tyyyyyy C March 9, 2023, 11:01 a.m. OK GNU C++14 TESTS 32 124 18227200
196665517 Splashing C March 9, 2023, 1:50 p.m. OK GNU C++14 TESTS 32 140 4812800
196623849 LWLAymh C March 9, 2023, 10:44 a.m. OK GNU C++14 TESTS 32 140 7987200
196727084 shenmewanyi C March 10, 2023, 1:06 a.m. OK GNU C++14 TESTS 32 140 9830400
196730870 shenmewanyi C March 10, 2023, 2:39 a.m. OK GNU C++14 TESTS 32 140 11366400
196726580 zrt0704 C March 10, 2023, 12:51 a.m. OK GNU C++14 TESTS 32 140 15462400
196624214 zenghaowei C March 9, 2023, 10:45 a.m. OK GNU C++14 TESTS 32 140 20992000
196615030 CQYZWJH C March 9, 2023, 10:15 a.m. OK GNU C++14 TESTS 32 155 7475200
196664065 p_s_c_ C March 9, 2023, 1:43 p.m. OK GNU C++17 TESTS 32 140 8192000
196666834 Weobe C March 9, 2023, 1:56 p.m. OK GNU C++17 TESTS 32 155 7372800
196643882 erekle C March 9, 2023, 11:50 a.m. OK GNU C++17 TESTS 32 155 8192000
196665029 beedle C March 9, 2023, 1:48 p.m. OK GNU C++17 TESTS 32 155 9011200
196671373 culver0412 C March 9, 2023, 2:23 p.m. OK GNU C++17 TESTS 32 155 15360000
196628614 Kieray C March 9, 2023, 11 a.m. OK GNU C++17 TESTS 32 156 5632000
196618367 JOHNKRAM C March 9, 2023, 10:25 a.m. OK GNU C++17 TESTS 32 156 7372800
196622060 pl_er C March 9, 2023, 10:38 a.m. OK GNU C++17 TESTS 32 156 9011200
196610779 blackyuki C March 9, 2023, 10:02 a.m. OK GNU C++17 TESTS 32 156 9011200
196743251 JosthnaBattu_28 C March 10, 2023, 6:04 a.m. OK GNU C++17 TESTS 32 156 11366400
196665215 FredYourMind C March 9, 2023, 1:49 p.m. OK GNU C++17 (64) TESTS 32 93 10649600
196610970 QAQAutoMaton C March 9, 2023, 10:03 a.m. OK GNU C++17 (64) TESTS 32 93 17920000
196624178 JJcjn C March 9, 2023, 10:45 a.m. OK GNU C++17 (64) TESTS 32 108 37478400
196682830 AmirAli-Asgari C March 9, 2023, 3:53 p.m. OK GNU C++17 (64) TESTS 32 109 18227200
196670341 Dawnq C March 9, 2023, 2:16 p.m. OK GNU C++17 (64) TESTS 32 139 10444800
196629725 michao C March 9, 2023, 11:03 a.m. OK GNU C++17 (64) TESTS 32 139 20275200
196618892 loveye C March 9, 2023, 10:27 a.m. OK GNU C++17 (64) TESTS 32 140 10444800
196723988 JWRuixi C March 9, 2023, 11:32 p.m. OK GNU C++17 (64) TESTS 32 140 11571200
196606986 MatikaneTannhauser C March 9, 2023, 9:53 a.m. OK GNU C++17 (64) TESTS 32 140 43315200
196643935 jockbutt C March 9, 2023, 11:50 a.m. OK GNU C++17 (64) TESTS 32 140 52428800
196617295 I_LOVE_DASHA_KARPENKO C March 9, 2023, 10:22 a.m. OK GNU C++20 (64) TESTS 32 93 4812800
196700466 SA01 C March 9, 2023, 6:13 p.m. OK GNU C++20 (64) TESTS 32 93 13619200
196685437 dbsic211 C March 9, 2023, 4:13 p.m. OK GNU C++20 (64) TESTS 32 108 11264000
196666026 happypotato C March 9, 2023, 1:52 p.m. OK GNU C++20 (64) TESTS 32 108 11264000
196725889 devout C March 10, 2023, 12:32 a.m. OK GNU C++20 (64) TESTS 32 109 4812800
196729972 zhangyi02 C March 10, 2023, 2:19 a.m. OK GNU C++20 (64) TESTS 32 109 9932800
196610041 QwQcOrZ C March 9, 2023, 10 a.m. OK GNU C++20 (64) TESTS 32 109 10444800
196632440 wind_cross C March 9, 2023, 11:12 a.m. OK GNU C++20 (64) TESTS 32 109 13004800
196633133 satyam343 C March 9, 2023, 11:15 a.m. OK GNU C++20 (64) TESTS 32 109 13107200
196624480 Sofapuden C March 9, 2023, 10:46 a.m. OK GNU C++20 (64) TESTS 32 109 13926400
196668347 profchi C March 9, 2023, 2:04 p.m. OK Java 11 TESTS 32 639 22937600
196656218 TCchen C March 9, 2023, 12:28 p.m. OK Java 17 TESTS 32 467 7065600
196714271 fetetriste C March 9, 2023, 8:39 p.m. OK Java 8 TESTS 32 483 16486400
196620733 iakovlev.zakhar C March 9, 2023, 10:33 a.m. OK Java 8 TESTS 32 779 35225600
196735512 Java_Programmer C March 10, 2023, 4:17 a.m. OK Java 8 TESTS 32 920 56115200
196610502 FastFreeTask C March 9, 2023, 10:01 a.m. OK Kotlin 1.6 TESTS 32 452 12595200
196627851 Hakiobo C March 9, 2023, 10:57 a.m. OK Kotlin 1.6 TESTS 32 795 9216000
196653223 dyppp C March 9, 2023, 12:19 p.m. OK PyPy 3-64 TESTS 32 576 52531200
196687469 tamato C March 9, 2023, 4:30 p.m. OK PyPy 3-64 TESTS 32 841 85811200
196617305 toam C March 9, 2023, 10:22 a.m. OK PyPy 3-64 TESTS 32 950 110182400
196625034 chinerist C March 9, 2023, 10:48 a.m. OK PyPy 3-64 TESTS 32 982 71782400

remove filters

Back to search problems