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

Poi

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

의견: 0

설명

August 8 – 15, Plovdiv, Bulgaria

Contest Day 1 - POI

English 1.1

POI
Full Feedback Problem

The local Plovdiv Olympiad in Informatics (POI) was held according to the following unusual
rules. There were N contestants and T tasks. Each task was graded with only one test case,
therefore for every task and every contestant there were only two possibilities: either the
contestant solved the task, or the contestant did not solve the task. There was no partial scoring
on any task.

The number of points assigned to each task was determined after the contest and was equal to
the number of contestants that did not solve the task. The score of each contestant was equal to
the sum of points assigned to the tasks solved by that contestant.

Philip participated in the contest, but he is confused by the complicated scoring rules, and now
he is staring at the results, unable to determine his place in the final standings. Help Philip by
writing a program that calculates his score and his ranking.

Before the contest, the contestants were assigned unique IDs from 1 to N inclusive. Philip’s ID
was P. The final standings of the competition list the contestants in descending order of their
scores. In case of a tie, among the tied contestants, those who have solved more tasks will be
listed ahead of those who have solved fewer tasks. In case of a tie by this criterion as well, the
contestants with equal results will be listed in ascending order of their IDs.

TASK
Write a program that, given which problems were solved by which contestant, determines
Philip’s score and his rank in the final standings.

EXAMPLE

Sample Input

Sample Output
5 3 2
0 0 1
1 1 0
1 0 0
1 1 0
1 1 0
3 2

The first problem was unsolved by only one contestant, so it is worth 1 point. The second
problem was unsolved by two contestants, so it is worth 2 points. The third problem was
unsolved by four contestants, so it is worth 4 points. Thus the first contestant has a score of 4;
the second contestant (Philip), the fourth and the fifth contestants all have a score of 3; and the
third contestant has a score of 1. Contestants 2, 4 and 5 are all tied according to the first tie-
break rule (number of problems solved), and according to the second tie-break rule (smaller ID)
Philip ranks before the others. Thus Philip’s rank in the final standings is 2. He is only behind the
contestant with ID 1.

제약

1 ≤ N ≤ 2,000
The number of contestants
1 ≤ T ≤ 2,000
The number of tasks
1 ≤ P ≤ N

Philip’s ID

입력 형식

Your program must read from standard input the following data:
• The first line contains the integers N, T and P, separated by individual spaces.
• The next N lines describe which tasks were solved by which contestant. The kth of these lines
describes which tasks were solved by the contestant with ID k. Each such line contains T
integers, separated by spaces. The first of these numbers denotes whether or not contestant
k solved the first task. The second number denotes the same for the second task and so on.
These T numbers are all either 0 or 1, where 1 means that contestant k solved the
corresponding task, and 0 means that he or she did not solve it.

출력 형식

Your program must write to standard output a single line with two integers separated by a single
space. First, the score that Philip got on the POI competition. Second, Philip’s rank in the final
standings. The rank is an integer between 1 and N inclusive, with 1 denoting the contestant

August 8 – 15, Plovdiv, Bulgaria

Contest Day 1 - POI

English 1.1

listed at the top (i.e., a contestant who has the highest score) and N to the one listed at the
bottom (i.e., a contestant with the lowest score).

GRADING
For a number of tests, worth a total of 35 points, no other contestant will have the same score as
Philip.

문제 정보

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

출처 IOI 2009

평가 및 의견

Poi

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

Log in to rate problems.

개별 의견

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

풀이 제출

Poi

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