포럼
문제 ICPC00338

L. Lopsided Lineup

설명

Together with your coworker, Sergey, you are organizing the exciting Billiards and Pool Competition for your coworkers in your small company. However, communication has not been great between you two. You are not sure you and Sergey think alike, but as far as you are concerned, this would be a great opportunity to do some team building. The actual prizes are meaningless, but there is possibly a lot to be gained from this in team bonding. You want to maximise result.

You start reading some pseudo-scientific books on team management, and after some research, you conclude that there are two good ways of team bonding: people feel more connected after either a triumphant victory or a crushing defeat. This gives you a great idea: if you divide your coworkers into two groups that are as far apart in skill level as possible, both teams will experience improved bonding! You therefore think it is optimal to try to make the teams as unbalanced as possible. Make sure, however, that the teams are of equal size.

With a bit of work you come up with a nice model for the strength of a team. You think team strength is mainly determined by how well two players play together, whether they encourage one another and complement each other's weaknesses. Whenever two players \(i\) and \(j\) are in the same team, they increase the team score by an integer \(c_{i,j}\). The total score of a team is thus equal to the sum of \(c_{i,j}\), over all unordered pairs of players \(i\) and \(j\) in the team.

제약
입력 형식

The input consists of:
- One line with an even integer \(n\) (\(2\leq n\leq 1000\)), the total number of players.
- \(n\) lines, the \(i\)th of which contains \(n\) integers \(c_{i,1}, c_{i,2}, \dots, c_{i, n}\) (\(-10^6 \leq c_{i,j} \leq 10^6\)).

For any \(i\) and \(j\), it is guaranteed that \(c_{i,i} = 0\) and \(c_{i,j} = c_{j,i}\).

출력 형식

Output the maximum possible difference in strength between two teams of equal size.

예제 1
입력
6
0 4 -6 2 3 -3
4 0 2 -6 0 0
-6 2 0 0 2 2
2 -6 0 0 -1 5
3 0 2 -1 0 -4
-3 0 2 5 -4 0
출력
0
예제 2
입력
4
0 1 2 2
1 0 8 -3
2 8 0 5
2 -3 5 0
출력
6
문제 정보

생성자가 기록되지 않았습니다.

출처 ICPC BAPC 2021

평가 및 의견

L. Lopsided Lineup

개요
출제자 난이도 Unrated 레이팅 미적용 의견 0 / 1 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

아직 의견이 없습니다. 자격이 된다면 위 양식에서 가장 먼저 평가해 보세요.

풀이 제출

L. Lopsided Lineup

게스트로 둘러보고 있습니다. 로그인하면 풀이를 제출하고 진행 상황을 확인할 수 있습니다. 로그인하고 제출하기
공개
C++20 Tab 들여쓰기 · Ctrl+/ 주석 토글 · Enter 자동 들여쓰기
1 1 1 0 공백: 4 · UTF-8