Logo
(追記) (追記ここまで)

32892번 - Dutch Democracy 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
2 초 (추가 시간 없음) 1024 MB106614068.966%

문제

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:

Strict Majority: The total number of seats held by the coalition must be strictly more than half of the total seats across all parties.

No Superfluous 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.

Figure D.1: Illustration of Sample Input 2.

입력

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

예제 출력 1

4

예제 입력 2

11
191 24 148 38 8 28 9 1 3 3 12

예제 출력 2

38

예제 입력 3

4
1 2 3 4

예제 출력 3

3

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > NWERC 2024 D번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /