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

Tenis

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

의견: 0

설명

Mirko is a big fan of tennis. Soon an important tournament with \(n\) players will take place. Mirko has
spent years researching tennis players and has collected various statistics about the competitors. He has
ranked their ability on three different courts: grass, clay and hard. More precisely, for each court he has
determined the order (rank list) of the players, with the first player being the strongest, and the last being
the weakest.
On this tournament, every player will play against every other player exactly once, so there will be {n}{n}}^{1)
2
matches in total. A tennis match cannot end in a draw, and the player who is stronger on the court
the match is played on will win. The organisers know that, so they have decided that each match
should be played on the court for which the winner will be the strongest, i.e. have the best position in the
corresponding rank list. If some courts are equal in that sense (the position of the winner of the match
between players \(A\) and \(B\) would be the same, e.g. player \(A\) would win on court 1, and player \(B\) on court
2, and they are both ranked third on the corresponding court rank lists), they will choose the court for
which the loser would have the best position. If the courts are still equal, the one with the smallest index
is chosen.
Determine the outcome of this tournament: the number of matches played on each court and the number
of wins for each player.

제약

Subtask 1 (35 points): \(1 \le n \le 300\)

Subtask 2 (15 points): \(1 \le n \le 3000\)

Subtask 3 (60 points): \(1 \le n \le 100\,000\) If your solution prints at least one of the lines correctly on each test case of a subtask, but it doesn’t print both lines correctly on at least one test case, you will get half of the points for that subtask.

입력 형식

The first line contains an integer \(n\), the number of players. The players are labeled with integers from 1 to
\(n\).
The \(i-th\) of the following three lines contains a permutation of integers from 1 to \(n\), the rank list of the
players for the \(i-th\) surface, starting with the strongest player.

출력 형식

In the first line, print the number of matches played on the first, second and third surface.
In the second line, print the number of matches won by each player from 1 to \(n\).

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

1

35점

\(1 \le n \le 300\)

2

15점

\(1 \le n \le 3000\)

3

60점

\(1 \le n \le 100\,000\) If your solution prints at least one of the lines correctly on each test case of a subtask, but it doesn’t print both lines correctly on at least one test case, you will get half of the points for that subtask.

예제 1
입력
3
3 2 1
1 3 2
3 2 1
출력
1 2 0
2 0 1
예제 2
입력
4
4 3 2 1
3 1 2 4
1 2 3 4
출력
3 2 1
1 0 2 3
문제 정보

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

출처 COCI 2020/2021 Contest 1

평가 및 의견

Tenis

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

Log in to rate problems.

개별 의견

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

풀이 제출

Tenis

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