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

Vudu

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

의견: 0

설명

\(2^{th}\) round, November \(7^{th}\) 2015
Young Mirko has been buying voodoo dolls lately. Considering that he is very interested in the cheapest
purchase possible, he has been tracking the prices of voodoo dolls each day. His price list consists of
doll prices in the last \(N\) days, where doll price \(a\)\(i\) represents the price of a doll \(i\) days ago.
Mirko thinks he has noticed a connection between the average doll price in a sequence of consecutive
days and the price on the following day. He wants to test his hunch and is puzzled by a very interesting
question: “For a given \(P\), how many different consecutive subsequences in the last \(N\) days are there,
when the average doll price was greater than or equal to \(P\)?”
Two consecutive subsequences are considered different if their beginnings or ends are different.

제약

In test cases worth 30% of points the sequence length \(N\) will be less than or equal to 10 000.

입력 형식

The first line of input contains the integer \(N\), the sequence length (1 ⩽\(N\) ⩽1 000 000).
The second line of input contains \(N\) prices \(a@@RISE_MATH_BLOCK_0@@i\) ⩽1 000 000 000).
The third line of input contains an integer \(P\). (0 ⩽\(P\) ⩽1 000 000 000).

출력 형식

The first and only line of output must contain the answer to Mirko’s question for a given \(P\).

예제 1
입력
3
1 2 3
3
3
1 3 2
2
3
1 3 2
3
출력
output
output
1
5
1
설명

Clarification of the first example: The only subsequence that has an average greater than or equal to 3 is
{3}.
Clarification of the second example: The subsequences that have an average greater than or equal to 2
are {1, 3}, {1, 3, 2}, {3}, {3, 2}, {2}.

문제 정보

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

출처 COCI 2015/2016 Contest 2

평가 및 의견

Vudu

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

Log in to rate problems.

개별 의견

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

풀이 제출

Vudu

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