Codeforces Round 568 (Div. 2)

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
1185 Codeforces Round 568 (Div. 2) FINISHED False 8100 170867699 June 19, 2019, 2:45 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 768 ) G2 Playlist for Polycarp (hard version) PROGRAMMING combinatorics dp 2800

B'The only difference between easy and hard versions is constraints. Polycarp loves to listen to music, so he never leaves the player, even on the way home from the university. Polycarp overcomes the distance from the university to the house in exactly T minutes. In the player, Polycarp stores n songs, each of which is characterized by two parameters: t_i and g_i , where t_i is the length of the song in minutes ( 1 <= t_i <= 50 ), g_i is its genre ( 1 <= g_i <= 3 ). Polycarp wants to create such a playlist so that he can listen to music all the time on the way from the university to his home, and at the time of his arrival home, the playlist is over. Polycarp never interrupts songs and always listens to them from beginning to end. Thus, if he started listening to the i -th song, he would spend exactly t_i minutes on its listening. Polycarp also does not like when two songs of the same genre play in a row (i.e. successively/adjacently) or when the songs in his playlist are repeated. Help Polycarpus count the number of different sequences of songs (their order matters), the total duration is exactly T , such that there are no two consecutive songs of the same genre in them and all the songs in the playlist are different. The first line of the input contains two integers n and T ( 1 <= n <= 50, 1 <= T <= 2500 ) -- the number of songs in the player and the required total duration, respectively. Next, the n lines contain descriptions of songs: the i -th line contains two integers t_i and g_i ( 1 <= t_i <= 50, 1 <= g_i <= 3 ) -- the duration of the i -th song and its genre, respectively. Output one integer -- the number of different sequences of songs, the total length of exactly T , such that there are no two consecutive songs of the same genre in them and all the songs in the playlist are different. Since the answer may be huge, output i'...

Tutorials

Editorial for Codeforces Round #568 (Div. 2)

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
56264204 ninety9 G2 June 29, 2019, 9:15 a.m. OK GNU C11 TESTS 105 1060 220569600 2800
55809847 XiaoDan G2 June 20, 2019, 2:51 a.m. OK GNU C++11 TESTS 105 31 33587200 2800
57638134 katy0308 G2 July 24, 2019, 11:37 a.m. OK GNU C++11 TESTS 105 31 39321600 2800
56967959 2829908231 G2 July 13, 2019, 9:01 a.m. OK GNU C++11 TESTS 105 31 67072000 2800
56111512 huangzhen G2 June 26, 2019, 4:07 p.m. OK GNU C++11 TESTS 105 31 262758400 2800
55823932 vjudge3 G2 June 20, 2019, 9:53 a.m. OK GNU C++11 TESTS 105 46 34611200 2800
56605567 Drumer G2 July 6, 2019, 4:20 a.m. OK GNU C++11 TESTS 105 46 35942400 2800
55825642 Winniechen G2 June 20, 2019, 10:43 a.m. OK GNU C++11 TESTS 105 46 64307200 2800
55836818 scauweng G2 June 20, 2019, 3:46 p.m. OK GNU C++11 TESTS 105 46 70656000 2800
55807650 Hazyknight G2 June 20, 2019, 12:39 a.m. OK GNU C++11 TESTS 105 62 67174400 2800
55916012 omochan G2 June 22, 2019, 5:27 a.m. OK GNU C++11 TESTS 105 62 159641600 2800
55807804 fmota G2 June 20, 2019, 12:52 a.m. OK GNU C++14 TESTS 105 31 31948800 2800
56158051 priyesh_coder G2 June 27, 2019, 11:10 a.m. OK GNU C++14 TESTS 105 31 33587200 2800
55839906 Jester G2 June 20, 2019, 5:23 p.m. OK GNU C++14 TESTS 105 46 28672000 2800
55818161 yan-zp G2 June 20, 2019, 7:19 a.m. OK GNU C++14 TESTS 105 46 28774400 2800
55984531 shdut G2 June 24, 2019, 1:52 a.m. OK GNU C++14 TESTS 105 46 28774400 2800
60716468 Scut82 G2 Sept. 17, 2019, 10:50 a.m. OK GNU C++14 TESTS 105 46 29388800 2800
56144038 sillysilly G2 June 27, 2019, 5:11 a.m. OK GNU C++14 TESTS 105 46 30720000 2800
55807888 fmota G2 June 20, 2019, 12:58 a.m. OK GNU C++14 TESTS 105 46 31948800 2800
56144340 Newusers G2 June 27, 2019, 5:22 a.m. OK GNU C++14 TESTS 105 46 33587200 2800
55812345 beginend G2 June 20, 2019, 4:35 a.m. OK GNU C++14 TESTS 105 46 64409600 2800
55990259 S1lv3r G2 June 24, 2019, 7:12 a.m. OK GNU C++17 TESTS 105 31 30003200 2800
55837283 temp66 G2 June 20, 2019, 4:01 p.m. OK GNU C++17 TESTS 105 46 27340800 2800
55836979 temp66 G2 June 20, 2019, 3:51 p.m. OK GNU C++17 TESTS 105 46 27340800 2800
55916343 cjnwq G2 June 22, 2019, 5:37 a.m. OK GNU C++17 TESTS 105 46 30617600 2800
56001377 JZmster G2 June 24, 2019, 1:11 p.m. OK GNU C++17 TESTS 105 46 32972800 2800
55828796 Als123 G2 June 20, 2019, 12:10 p.m. OK GNU C++17 TESTS 105 62 35532800 2800
55848193 hyfzbtrs G2 June 21, 2019, 12:36 a.m. OK GNU C++17 TESTS 105 62 64409600 2800
61220703 C20193620 G2 Sept. 24, 2019, 1:51 p.m. OK GNU C++17 TESTS 105 62 64409600 2800
56037992 Trote_w G2 June 25, 2019, 12:59 p.m. OK GNU C++17 TESTS 105 77 32972800 2800
61302510 C20193620 G2 Sept. 26, 2019, 5:42 a.m. OK GNU C++17 TESTS 105 77 69222400 2800
55934035 Nipun_iiitd G2 June 22, 2019, 12:59 p.m. OK Java 8 TESTS 105 327 4915200 2800
56023640 Oopsimbad G2 June 25, 2019, 5:42 a.m. OK Java 8 TESTS 105 1029 0 2800
55817191 uwi G2 June 20, 2019, 6:57 a.m. OK Java 8 TESTS 105 1262 17305600 2800
55817743 insert_cool_handle G2 June 20, 2019, 7:09 a.m. OK Java 8 TESTS 105 1357 75980800 2800
55847392 Rahmeh9 G2 June 20, 2019, 11:14 p.m. OK Java 8 TESTS 105 1621 5120000 2800
55819130 insert_cool_handle G2 June 20, 2019, 7:43 a.m. OK Java 8 TESTS 105 1637 5120000 2800
55818968 insert_cool_handle G2 June 20, 2019, 7:40 a.m. OK Java 8 TESTS 105 1653 5120000 2800
67066451 dalt G2 Dec. 17, 2019, 11:17 a.m. OK Java 8 TESTS 105 1762 168140800 2800
55857411 ZeyadKhattab G2 June 21, 2019, 7:42 a.m. OK Java 8 TESTS 105 2496 258867200 2800
56045033 neel1997 G2 June 25, 2019, 4:10 p.m. OK Java 8 TESTS 105 2527 258969600 2800
56501339 S.K G2 July 4, 2019, 6:29 a.m. OK MS C++ TESTS 105 62 64307200 2800
56775809 vjudge2 G2 July 10, 2019, 2:34 a.m. OK MS C++ TESTS 105 93 42291200 2800
56501272 S.K G2 July 4, 2019, 6:27 a.m. OK MS C++ TESTS 105 2012 7782400 2800
56754818 xsc G2 July 9, 2019, 1:26 p.m. OK MS C++ 2017 TESTS 105 514 28672000 2800
55870483 tuna_salad G2 June 21, 2019, 2:24 p.m. OK Rust TESTS 105 841 24576000 2800
66320425 sansen G2 Dec. 5, 2019, 1:49 p.m. OK Rust TESTS 105 1044 7372800 2800

remove filters

Back to search problems