Codeforces Round 743 (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
1572 Codeforces Round 743 (Div. 1) FINISHED False 7200 105290663 Sept. 18, 2021, 2:35 p.m.

Problems

Solved$
Index
Name
Type
Tags
Community Tag
Rating
( 527 ) D Bridge Club PROGRAMMING flows graphs greedy 2800

B'There are currently n hot topics numbered from 0 to n-1 at your local bridge club and 2^n players numbered from 0 to 2^n-1 . Each player holds a different set of views on those n topics, more specifically, the i -th player holds a positive view on the j -th topic if i & 2^j > 0 , and a negative view otherwise. Here & denotes the bitwise AND operation. You are going to organize a bridge tournament capable of accommodating at most k pairs of players (bridge is played in teams of two people). You can select teams arbitrarily while each player is in at most one team, but there is one catch: two players cannot be in the same pair if they disagree on 2 or more of those n topics, as they would argue too much during the play. You know that the i -th player will pay you a_i dollars if they play in this tournament. Compute the maximum amount of money that you can earn if you pair the players in your club optimally. The first line contains two integers n , k ( 1 <= n <= 20 , 1 <= k <= 200 ) -- the number of hot topics and the number of pairs of players that your tournament can accommodate. The second line contains 2^n integers a_0, a_1, ... , a_{2^n-1} ( 0 <= a_i <= 10^6 ) -- the amounts of money that the players will pay to play in the tournament. Print one integer: the maximum amount of money that you can earn if you pair the players in your club optimally under the above conditions. In the first example, the best we can do is to pair together the 0 -th player and the 2 -nd player resulting in earnings of 8 + 5 = 13 dollars. Although pairing the 0 -th player with the 5 -th player would give us 8 + 10 = 18 dollars, we cannot do this because those two players disagree on 2 of the 3 hot topics. In the second example, we can pair the 0 -th player with the 1 -st player and pair t'...

Tutorials

Tutorial

Submissions

Submission Id
Author(s)
Index
Submitted
Verdict
Language
Test Set
Tests Passed
Time taken (ms)
Memory Consumed (bytes)
Tags
Rating
129232233 dai D Sept. 19, 2021, 4:54 a.m. OK GNU C++14 TESTS 200 1060 10956800 2800
129210112 nwi D Sept. 18, 2021, 5:54 p.m. OK GNU C++14 TESTS 200 1372 31744000 2800
129193759 scli_weapon D Sept. 18, 2021, 3:29 p.m. OK GNU C++14 TESTS 200 1715 60416000 2800
129201627 peehs_moorhsum D Sept. 18, 2021, 4:08 p.m. OK GNU C++14 TESTS 200 1824 26624000 2800
129225206 SHZhang2 D Sept. 19, 2021, 1:23 a.m. OK GNU C++17 TESTS 200 607 48435200 2800
129205082 cerberus97 D Sept. 18, 2021, 4:25 p.m. OK GNU C++17 TESTS 200 1169 10854400 2800
129206390 Molewus D Sept. 18, 2021, 4:32 p.m. OK GNU C++17 TESTS 200 1544 201830400 2800
129231252 sd0061 D Sept. 19, 2021, 4:30 a.m. OK GNU C++17 TESTS 200 2214 304435200 2800
129212649 Shayan.P D Sept. 18, 2021, 6:34 p.m. OK GNU C++17 TESTS 200 2324 235008000 2800
129228525 sd0061 D Sept. 19, 2021, 3:15 a.m. OK GNU C++17 TESTS 200 2386 304435200 2800
129230288 sd0061 D Sept. 19, 2021, 4:05 a.m. OK GNU C++17 TESTS 200 2433 304435200 2800
129230044 sd0061 D Sept. 19, 2021, 4 a.m. OK GNU C++17 TESTS 200 2495 338329600 2800
129230810 sd0061 D Sept. 19, 2021, 4:19 a.m. OK GNU C++17 TESTS 200 2496 304435200 2800
129230270 sd0061 D Sept. 19, 2021, 4:05 a.m. OK GNU C++17 TESTS 200 2496 338329600 2800
129233160 p_b_p_b D Sept. 19, 2021, 5:17 a.m. OK GNU C++17 (64) TESTS 200 374 53452800 2800
129209297 maroonrk D Sept. 18, 2021, 5:44 p.m. OK GNU C++17 (64) TESTS 200 404 18534400 2800
129212785 kefaa2 D Sept. 18, 2021, 6:35 p.m. OK GNU C++17 (64) TESTS 200 623 54988800 2800
129199613 Benq D Sept. 18, 2021, 3:59 p.m. OK GNU C++17 (64) TESTS 200 717 12288000 2800
129205002 natsugiri D Sept. 18, 2021, 4:24 p.m. OK GNU C++17 (64) TESTS 200 733 13926400 2800
129220190 jeroenodb D Sept. 18, 2021, 9:07 p.m. OK GNU C++17 (64) TESTS 200 951 25907200 2800
129192769 tourist D Sept. 18, 2021, 3:25 p.m. OK GNU C++17 (64) TESTS 200 1092 185344000 2800
129209734 emorgan5289 D Sept. 18, 2021, 5:49 p.m. OK GNU C++17 (64) TESTS 200 1512 17408000 2800
129229086 kimoyami D Sept. 19, 2021, 3:32 a.m. OK GNU C++17 (64) TESTS 200 1591 16896000 2800
129201185 hos.lyric D Sept. 18, 2021, 4:06 p.m. OK GNU C++17 (64) TESTS 200 1653 143974400 2800

remove filters

Back to search problems