RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
ICPC00039

G. Metal Processing Plant

Unrated 레이팅 미적용
난이도
4s
시간 제한
1024MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Yulia works for a metal processing plant in E\(ka- te\)rinburg. This plant processes ores mined in the Ural mountains, extracting precious metals such as chalcopyrite, platinum and gold from the ores. Every month the plant receives \(n\) shipments of \(un- pr\)ocessed ore. Yulia needs to partition these sh\(ip- me\)nts into two groups based on their similarity. Then, each group is sent to one of two ore p\(ro- ce\)ssing buildings of the plant. To perform this partitioning, Yulia first calculates a numeric distance \(d\)(i, j) for each pair of sh\(ip- me\)nts \(1 \le i \le n\) and \(1 \le j \le n\), where the smaller the distance, the more similar the sh\(ip- me\)nts \(i\) and \(j\) are. For a subset \(S\) ⊆{1, . . . , n} of shipments, she then defines the disparity \(D\) of \(S\) as the maximum distance between a pair of shipments in the subset, that is, \(D\)(\(S\)) = max {i,j} }_{S{d}}^{i, j{)} Yulia then partitions the shipments into two subsets \(A\) and \(B\) in such a way that the sum of their disp\(ar- it\)ies \(D\)(\(A\)) + \(D\)(\(B\)) is minimized. Your task is to help her find this partitioning.

제약
입력 형식

The input consists of a single test case. The first line contains an integer \(n\) (\(1 \le n \le 200\)) indicating the number of shipments. The following \(n - 1\) lines contain the distances \(d\)(i, j). The \(i^{th}\) of these lines contains \(n - i\) integers and the \(j^{th}\) integer of that line gives the value of \(d\)(i, \(i + j\)). The distances are symmetric, so \(d\)(j, i) = \(d\)(i, j), and the distance of a shipment to itself is 0. All distances are integers between 0 and \(10^{9}\) (inclusive).

출력 형식

Display the minimum possible sum of disparities for partitioning the shipments into two groups.

예제 1
입력
5
4 5 0 2
1 3 7
2 0
4
출력
4
예제 2
입력
7
1 10 5 5 5 5
5 10 5 5 5
100 100 5 5
10 5 5
98 99
3
출력
15
문제 정보

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

출처 ICPC World Finals 2014

평가 및 의견

G. Metal Processing Plant

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

Log in to rate problems.

개별 의견

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

풀이 제출

G. Metal Processing Plant

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