RiseOJ는 solved.ac와 제휴 관계가 없습니다. 티어 아이콘 © solved.ac. solved.ac
포럼
USACO0136 파일 입출력

Cow Decathlon

Platinum IV 플래티넘 IV
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Farmer John's N cows (1 <= N <= 20), conveniently labeled 1...N, are preparing for a decathlon that has N different events.

Cow i has a skill level of s_ij (1 <= s_ij <= 1000) when competing in event j. Each cow must compete in one and only one event, and each event must have some cow competing in it.

The total score for all cows is the sum of their skill levels for the events in which they are competing. However, the event judges can also give out bonus points. There are B bonuses (1 <= B <= 20). Bonus i has three parts: if the cows obtain at least P_i points (1 <= P_i <= 40,000) for the first K_i events (including other bonuses involving just those events), they will get an additional A_i points (1 <= A_i <= 1000).

Please help decide which events the cows should attempt to maximize their total score.

제약
입력 형식

Line 1: Two space-separated integers: N, B

Lines 2..B+1: Line i+1 will contain the information for bonus i: three space-separated integers K_i, P_i, A_i.

Lines B+2..B+N+1: Line B+1+j will contain N space-separated integers s_j1...s_jN describing how cow j performs at each event.

출력 형식

The maximum amount of points that the cows can receive, including bonuses.

파일 입력 / 출력
이 문제는 표준 입출력을 사용하지 않습니다. 프로그램은 다음 파일을 읽고 써야 합니다:
입력을 읽을 파일 dec.in
출력을 쓸 파일 dec.out
예제 1
입력
3 1
2 7 6
5 1 7
2 2 4
4 2 1
출력
17
설명

Output details: Cow 1 does event 1, cow 3 does event 2, cow 2 does event 3, scoring 5+2+4 plus a 6-point bonus = 17.

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2013-2014 > February > Gold

태그

평가 및 의견

Cow Decathlon

개요
출제자 난이도 Platinum IV 플래티넘 IV 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Cow Decathlon

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