포럼
문제 ICPC00223

D. Dutch Democracy

설명

The process of forming the Dutch government has taken more than half a year for three elections in a row. Perhaps we can streamline the initial stages of coalition building?

The first step after the election results is to find a group of parties (called a coalition) with enough seats to have a strict majority. Your task is to count the number of candidate coalitions that satisfy specific conditions. A coalition is considered a candidate coalition if it meets these two criteria:
- The total number of seats held by the coalition must be strictly more than half of the total seats across all parties.
- The coalition must be minimal in the sense that removing any one party from the coalition would cause it to lose its strict majority.

제약
입력 형식

The input consists of:
- One line with an integer \(n\) (\(1 \le n \le 60\)), the number of parties.
- One line with \(n\) integers \(p\) (\(1 \le p \le 10\,000\)), the number of seats each party has.

출력 형식

Output the total number of candidate coalitions that satisfy the criteria above.

예제 1
입력
5
3 1 4 1 5
출력
4
예제 2
입력
11
191 24 148 38 8 28 9 1 3 3 12
출력
38
예제 3
입력
4
1 2 3 4
출력
3
문제 정보

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

출처 ICPC NWERC 2024

평가 및 의견

D. Dutch Democracy

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

Log in to rate problems.

개별 의견

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

풀이 제출

D. Dutch Democracy

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