포럼
문제 ICPC00163

C. Cent Savings

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

To host a regional contest like NWERC a lot of preparation is necessary: organizing rooms and computers, making a good problem set, inviting contestants, designing T-shirts, booking hotel rooms and so on. I am responsible for going shopping in the supermarket.

When I get to the cash register, I put all my \(n\) items on the conveyor belt and wait until all the other customers in the queue in front of me are served. While waiting, I realize that this supermarket recently started to round the total price of a purchase to the nearest multiple of \(10\) cents (with \(5\) cents being rounded upwards). For example, \(94\) cents are rounded to \(90\) cents, while \(95\) are rounded to \(100\).

It is possible to divide my purchase into groups and to pay for the parts separately. I managed to find \(d\) dividers to divide my purchase in up to \(d+1\) groups. I wonder where to place the dividers to minimize the total cost of my purchase. As I am running out of time, I do not want to rearrange items on the belt.

제약
입력 형식

The input consists of:
- one line with two integers \(n\) (\(1 \leq n \le 2\,000\)) and \(d\) ($1 \leq
d \le 20$), the number of items and the number of available dividers;
- one line with \(n\) integers \(p_1, \ldots p_n\) (\(1 \leq p_i \leq 10\,000\) for \(1 \le i \le n\)), the prices of the items in cents. The prices are given in the same order as the items appear on the belt.

출력 형식

Output the minimum amount of money needed to buy all the items, using up to \(d\) dividers.

예제 1
입력
5 1
13 21 55 60 42
출력
190
예제 2
입력
5 2
1 1 1 1 1
출력
0
문제 정보

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

출처 ICPC NWERC 2014

평가 및 의견

C. Cent Savings

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

Log in to rate problems.

개별 의견

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

풀이 제출

C. Cent Savings

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