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

Eurokod

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

의견: 0

설명

This year, for the first time, the Eurokod is being held, an international competition
in writing beautiful and readable code!
There are \(n\) contestants participating in the competition, labeled with numbers
from 1 to \(n\), and each of them has written a code.
Their codes are evaluated by an association of computer scientists. The association
consists of a president and members of the association. The president awards
points to codes in one way, and the members of the association award points in
another way.
President’s points:
The president will rank the codes from the most beautiful to the least beautiful (in
his opinion). The first code will be awarded \(n\) points, and each subsequent code
will be awarded one point less than the previous one.
Members of the association’s points:
Each member of the association will vote for the code he considers the most beautiful. After each member
of the association has voted, the codes will be ranked in descending order according to the number of
votes they received from the members of the association. The first code (the one with the most votes) will
be awarded \(n\) points, and each subsequent code will be awarded one point less than the previous one.
Total points:
The total number of points for each code is equal to the sum of the points awarded by the president and
the number of points awarded by the members of the association.
Your task is to print the order of codes in descending order according to the number of points.
If more codes have the same number of points, then the better ranked one is the one that has won more
points from the members of the association.

제약

Subtask 1 (17 points): For each code, the number of obtained votes from the members of the association is equal to the number of points awarded by the members of the association, and there won’t be two codes that scored the same number of total points.

Subtask 2 (19 points): There won’t be two codes that scored the same number of total points.

Subtask 3 (14 points): No additional constraints.

입력 형식

The first line contains an integer \(n\) (\(1 \le n \le 50\)), the number of contestants.
The second line contains \(n\) integers \(a_{i}\) (\(1 \le a_{i} \le n\)), where the \(i-th\) integer represents the label of the code
that the president ranked \(i-th\). The ranking of the president is given in the order from the most beautiful
to the least beautiful, it contains all the labels from 1 to \(n\) exactly once.
The third line contains \(n\) integers \(b@@RISE_MATH_BLOCK_0@@i \le 200\)), where the \(i-th\) integer represents the number of votes
that the \(i-th\) code received from the members of the association. There won’t be two codes that received
the same number of votes.

출력 형식

In \(n\) lines, print the ranking of codes in descending order according to the number of points.
Each line should be in the form "[rank].
Kod[label] ([number of points])", where [rank] is the
rank of the code in the ranking, [label] is the label of the code written in t\(wo-di\)git form with leading
zeros, and [number of points] is the number of points that the code won.
For example, if the first place was won by the code with the label 3 with 12 points, then the first line is
"1.
Kod03 (12)".

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

1

17점

For each code, the number of obtained votes from the members of the association is equal to the number of points awarded by the members of the association, and there won’t be two codes that scored the same number of total points.

2

19점

There won’t be two codes that scored the same number of total points.

3

14점

No additional constraints.

예제 1
입력
3
1 2 3
50 10 20
출력
1. Kod01 (6)
2. Kod03 (3)
3. Kod02 (3)
예제 2
입력
5
5 2 4 1 3
4 5 2 1 3
출력
1. Kod02 (9)
2. Kod05 (8)
3. Kod01 (6)
4. Kod04 (4)
5. Kod03 (3)
예제 3
입력
7
6 3 2 1 5 4 7
200 56 11 0 13 105 12
출력
1. Kod06 (13)
2. Kod01 (11)
3. Kod02 (10)
4. Kod03 (8)
5. Kod05 (7)
6. Kod07 (4)
7. Kod04 (3)
설명

Clarification of the first example:
Kod03 and Kod02 have the same number of points, but Kod03 has more votes from the members of the
association, so it is better ranked.
Clarification of the second example:
The president ranked the Kod05 as the most beautiful, so it won n = 5 points.

문제 정보

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

출처 COCI 2023/2024 Contest 3

평가 및 의견

Eurokod

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

Log in to rate problems.

개별 의견

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

풀이 제출

Eurokod

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