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

Igre

설명

Kile has returned from a board game fair. He brought home \(n\) games. Before
playing a game, it is necessary to learn its rules. Learning the rules of the \(i\)-th
game takes \(p_{i}\) minutes. Once the rules are learned, it is possible to play the game.
Playing the \(i\)-th game takes \(t_{i}\) minutes. Each game also has its own rating \(o_{i}\).
In the coming days, Kile has planned to spend at most \(d\) minutes on board games.
He is interested in finding out the maximum sum of the ratings of the games he
can play. Each game can be played an arbitrary number of times.

제약
입력 형식

The first line contains integers \(n\) and \(d\) (\(1 \le n\), \(d \le 5000\)), the number of games and the time planned to
spend on playing games.
The \(i\)-th of the following n lines contains integers \(p_{i}\), \(t_{i}\) and \(o_{i}\) (\(0 \le p_{i} \le 5000\), \(1 \le t_{i} \le 5000\), \(1 \le o_{i} \le 10^{9}\)),
time required to learn the rules, time required to play and the rating of \(i\)-th game.

출력 형식

In the first and only line, output the maximum sum of the ratings of the games played.

서브태스크
서브태스크점수설명

1

6점

\(n = 1\)

2

13점

\(n \le 10\)

3

23점

\(p_{i} = 0\) for all \(i = 1\), ..., n

4

28점

No additional constraints.

예제 1
입력
3 10
2 3 5
5 1 5
3 2 5
출력
25
예제 2
입력
4 13
0 6 5
0 3 4
0 2 3
0 4 4
출력
19
예제 3
입력
3 10
1 1 1
3 2 3
2 3 5
출력
11
설명

Clarification of the third example:
One way to achieve a total score of 11 is as follows: in the first minute, Kile learns to play the first game,
then plays it once. After that, he spends two minutes learning to play the third game, and in the last 6
minutes, he plays it twice. This way, the total score of the games played is: 1 + 5 + 5 = 11.

문제 정보

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

출처 COCI 2024/2025 Contest 2

평가 및 의견

Igre

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

Log in to rate problems.

개별 의견

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

풀이 제출

Igre

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