Superbull
의견: 0
A total of N (1 <= N <= 2000) teams are playing in the Superbull. Each team has a distinct integer team ID in the range 1...2^30-1. The Superbull is an elimination tournament -- after every game, Farmer John chooses which team to eliminate, and the eliminated team can no longer play. The Superbull ends when only one team remains.
In any game, the combined score of the two teams always ends up being the bitwise exclusive OR (XOR) of the two team IDs. FJ wants to choose a series of games such that the total number of points scored in the Superbull is maximized. Please help Farmer John organize the matches.
Line 1: N. The following N lines contain the N team IDs.
The maximum possible number of points that can be scored in the Superbull.
superbull.insuperbull.out4
3
6
9
1037Output details: (3 XOR 9) + (6 XOR 9) + (6 XOR 10) = 10 + 15 + 12 = 37.
riseoj 작성
출처 올림피아드 > USACO > 2014-2015 > February > Silver
평가 및 의견
Superbull
아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.
풀이 제출
Superbull