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

Neboderi

Unrated 레이팅 미적용
난이도
2.500s
시간 제한
512MB
메모리 제한
0
맞았습니다!!
0
제출 수
0.0%
정답률
레이팅

의견: 0

설명

Domagoj is in the big city of London! Right now, there is a sequence of tall
skyscrapers in front of him and he wants to take a photograph to remember the
moment.
The sequence of skyscrapers can be represented as a sequence of \(n\) numbers
\(h\)1, h2, . . . , h\(n\) where the number \(h@@RISE_MATH_BLOCK_0@@l\) + . . . + \(h\)\(r\)).
Help Domagoj determine the beauty of the most beautiful photograph with at least \(k\) skyscrapers!

제약

Subtask 1 (11 points): n, \(k \le 100\)

Subtask 2 (22 points): n, \(k \le 5000\)

Subtask 3 (27 points): \(h_{i} \le 100\)

Subtask 4 (18 points): n, \(k \le 5 \cdot 10^{4}\)

Subtask 5 (32 points): No additional constraints.

입력 형식

The first line contains two integers \(n\), \(k\) (\(1 \le k \le n \le 10^{6}\)), the number of skyscrapers, and the number \(k\).
The second line contains \(n\) integers \(h_{1}\), h_{2}, . . . , h_{n} (\(1 \le h_{i} \le 10^{6}\)), the heights of the skyscrapers, in order.

출력 형식

Print a single line with the required number from the task.

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

1

11점

n, \(k \le 100\)

2

22점

n, \(k \le 5000\)

3

27점

\(h_{i} \le 100\)

4

18점

n, \(k \le 5 \cdot 10^{4}\)

5

32점

No additional constraints.

예제 1
입력
6 2
2 1 4 4 4 2
출력
48
예제 2
입력
4 1
7 3 9 4
출력
81
설명

Clarification of the first example:
Domagoj photographed skyscrapers ( 4, 4, 4 ), so the total beauty is 4 · (4 + 4 + 4) = 48
Clarification of the second example:
Domagoj photographed only the skyscraper ( 9 ), so the total beauty is 9 · 9 = 81.

문제 정보

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

출처 COCI 2022/2023 Contest 1

평가 및 의견

Neboderi

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

Log in to rate problems.

개별 의견

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

풀이 제출

Neboderi

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