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

Watching Mooloo

Silver III 실버 III
난이도
2s
시간 제한
256MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Bessie likes to watch shows on Mooloo. Because Bessie is a busy cow, she has
planned a schedule for the next \(N\) (\(1 \leq N \leq 10^5\)) days that she will
watch Mooloo. Because Mooloo is a paid subscription service, she now needs to
decide how to minimize the amount of money she needs to pay.

Mooloo has an interesting subscription system: it costs \(d + K\)
(\(1\le K\le 10^9\)) moonies to subscribe to Mooloo for \(d\) consecutive days. You
can start a subscription at any time, and you can start a new subscription as
many times as you desire if your current subscription expires. Given this,
figure out the minimum amount of moonies Bessie needs to pay to fulfill her
schedule.

Problem credits: Danny Mittal

제약

SCORING

  • Inputs 3-5: \(N \le 10\)
  • Inputs 6-12: No additional constraints.

Problem credits: Danny Mittal

입력 형식

The first line contains integers \(N\) and \(K\).

The second line contains \(N\) integers describing the days Bessie will watch
Mooloo:
\(1\le d_1.

출력 형식

Note that the large size of integers involved in this problem may require the
use of 64-bit integer data types (e.g., a "long long" in C/C++).

예제 1
입력
2 4
7 9
출력
7
설명

Bessie buys a three-day subscription on day 7, spending \(d+K = 3 + 4 = 7\)
moonies.

예제 2
입력
2 3
1 10
출력
8
설명

Bessie first buys a one-day subscription on day 1, spending \(d+K = 1+3 = 4\)
moonies. Bessie also buys a one-day subscription on day 10, spending
\(d+K = 1+3 = 4\) moonies. In total, Bessie spends 8 moonies.

문제 정보

riseoj 작성

출처 올림피아드 > USACO > 2022-2023 > February > Bronze

태그

평가 및 의견

Watching Mooloo

개요
출제자 난이도 Silver III 실버 III 의견 0 / 50 공개 집계 (커뮤니티 난이도, 주요 주제, 품질)는 의견이 충분히 모이면 공개됩니다.

Log in to rate problems.

개별 의견

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

풀이 제출

Watching Mooloo

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