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

Norma

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

의견: 0

설명

\(2^{nd}\) round, November \(8^{th}\), 2014
Mirko got an array of integers for his birthday from his grandmother Norma. As any other kid, he was hoping
for some money, but got an array. Luckily, in his town there is a pawn shop that buys up arrays. The cost of an
array of integers is m\(in \cdot ma\)\(x \cdot L\) kunas, where min is the minimal integer in the array, max is the maximal and L
is the array length. Mirko is going to sell a subsequence of consecutive numbers from his array. He calculated the
average price of all such subsequences.
In order to check his result, he wants you to do the same. He will be pleased with only the last 9 digits of the sum
of all prices, so you don’t need to bother with large and real numbers.

제약

In test cases worth 40% of total points, it will hold \(N < 5\,000\).

입력 형식

The first line of input contains an integer N (1 ⩽N ⩽500 000).
Each of the following N lines contains a member of Mirko’s array. The members of the array will be integers from
the interval [1, \(10^{8}\)].

출력 형식

The first and only line of output must contain an integer, the last 9 digits of the required sum from the task. You
don’t need to output the leading zeroes of that \(9-di\)git integer.

예제 1
입력
2
1
3
4
2
4
1
4
6
8
1
3
9
7
4
출력
output
output
16
109
1042
설명

Clarification of the first example: The array consists of two integers, 1 and 3. The possible subsequences Mirko can
sell are (1), (3) and (1,3), their prices being 1, 9 and 6, respectively, which is 16 summed up. Clarification of the second
example: The possible subsequences Mirko can sell are (2), (4), (1), (4), (2, 4), (4, 1), (1, 4), (2,4,1), (4,1,4) and (2,4,1,4).
Their prices are 4, 16, 1, 16, 16, 8, 8, 12, 12 and 16, respectively, which is 109 summed up.

문제 정보

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

출처 COCI 2014/2015 Contest 2

평가 및 의견

Norma

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

Log in to rate problems.

개별 의견

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

풀이 제출

Norma

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