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

F7

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

의견: 0

설명

\(1^{st}\) round, October \(20^{th}\), 2012

The fictional World Championship of Formula 7 Drivers 2012 was characterized by exciting races and
frequent shifts of driver positions on the leaderboard. Antun has missed most of it because he was
training for olympiads in informatics. Now his only consolation are his medals and being the main
character in this task. He has a simple question for you COCI contestants: „How many drivers
participating in this Championship still had a chance to become Formula 7 World Champion at the
start of the final race?” The World Champion is, of course, the driver with the largest point total at
the end (after the final race).
There are N drivers participating in the Championship. They are all assigned points after each race,
including the final one. The winner of the race is awarded N points, the runn\(er-up\) gets \(N - 1\) points,
and so on until the last driver, who gets 1 point. Two drivers cannot finish a race in the same spot.
Write a program to calculate, based on the total number of points that each driver has earned before
the final race, how many drivers still have a chance to have the largest total after the final race and thus
win the Championship. If more than one driver has the same maximum point total, they are all
awarded the World Champion title.

제약
입력 형식

The first line of input contains the positive integer N (\(3 \le N \le 300\,000\)), the number of drivers
participating in the Championship.
Each of the following N lines contains a single integer Bi (\(0 \le Bi \le 2\,000\,000\), \(i = 1\), ..., N), the
number of points that a driver has before the final race.

출력 형식

The first and only line of output should contain the requested number of drivers that can still win.

예제 1
입력
3
8
10
9
출력
3
예제 2
입력
5
15
14
15
12
14
출력
4
문제 정보

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

출처 COCI 2012/2013 Contest 1

평가 및 의견

F7

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

Log in to rate problems.

개별 의견

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

풀이 제출

F7

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