포럼
문제 ICPC00197

A. Average Rank

스페셜 저지 — 출력을 사용자 정의 프로그램으로 검사하므로 여러 정답이 인정될 수 있습니다.
설명

The National Weekly Escape Room Challenge (NWERC) is a long-running competition held in Eindhoven. Every week a new escape room is presented, and anyone who completes it in their first attempt gains one point.

At the end of each week, competitors are ranked by the total number of points accumulated so far, highest first. In case of a tie, they share the same rank. In other words, the rank of a competitor is one more than the number of people with a strictly larger number of points.

In total there have been \(n\) participants in the contest, and the contest has been going for \(w\) weeks. For each week you are given a list of the competitors that gained a point that week. Your task is to calculate the average rank during the \(w\)-week competition for each competitor.

Figure illustrates the score progression in the third sample.

제약
입력 형식

The input consists of:
- One line with two integers \(n\) and \(w\) (\(1 \le n, w \le 3 \cdot 10^5\)), the number of competitors and the number of weeks. The competitors are numbered from \(1\) to \(n\).
- \(w\) lines (one for each week), each containing an integer \(k\) (\(0 \le k \le n\)) followed by \(k\) distinct integers \(c_1, \ldots, c_k\) (\(1 \le c_i \le n\) for all \(i\)), indicating that the \(k\) competitors \(c_1, \ldots, c_k\) each gained a point that week.

The total number of points awarded is at most \(1\) million.

출력 형식

Output \(n\) lines, the \(i\)th of which contains the average rank of the \(i\)th competitor during the \(w\)-week competition. Your answers should have an absolute or relative error of at most \(10^{-6}\).

예제 1
입력
3 2
2 1 2
2 1 3
출력
1.000000
1.500000
2.500000
예제 2
입력
3 1
0
출력
1.000000
1.000000
1.000000
예제 3
입력
5 6
2 3 5
2 3 1
0
3 3 5 2
3 5 4 2
2 3 4
출력
3.166666667
3.333333333
1.000000000
3.833333333
1.666666667
문제 정보

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

출처 ICPC NWERC 2019

평가 및 의견

A. Average Rank

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

Log in to rate problems.

개별 의견

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

풀이 제출

A. Average Rank

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