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

B. Uniform Chemistry

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

In a parallel universe there are \(n\) chemical elements, numbered from 1 to \(n\). The element number \(n\) has not been discovered so far, and its discovery would be a pinnacle of research and would bring the person who does it eternal fame and the \(so-ca\)lled SWERC prize. There are \(m\) independent researchers, numbered from 1 to \(m\), that are trying to discover it. C\(ur- re\)ntly, the \(i-th\) researcher has a sample of the element \(s_{i}\). Every year, each researcher independently does one fusion experiment. In a fusion experiment, if the researcher currently has a sample of element \(a\), they produce a sample of an element \(b\) that is chosen uniformly at random between \(a+1\) and \(n\), and they lose the sample of element \(a\). The elements discovered by different researchers or in different years are completely independent. The first researcher to discover element \(n\) will get the SWERC prize. If several researchers discover the element in the same year, they all get the prize. For each \(i = 1\), 2, . . . , \(m\), you need to compute the probability that the \(i-th\) researcher wins the prize.

제약
입력 형식

The first line contains two integers \(n\) and \(m\) (\(2 \le n \le 100\), \(1 \le m \le 10\)) — the number of elements and the number of researchers. The second line contains \(m\) integers \(s_{1}\), \(s_{2}\), . . . , \(s_{m}\) (\(1 \le s_{i} < n\)) — the elements that the researchers currently have.

출력 형식

Print \(m\) floati\(ng-po\)int numbers. The \(i-th\) number should be the probability that the \(i-th\) researcher wins the SWERC prize. Your answer is accepted if each number differs from the correct number by at most \(10^{−8}\).

예제 1
입력
2 3
1 1 1
출력
1.0 1.0 1.0
예제 2
입력
3 3
1 1 2
출력
0.5 0.5 1.0
예제 3
입력
3 3
1 1 1
출력
0.625 0.625 0.625
예제 4
입력
100 7
1 2 4 8 16 32 64
출력
0.178593469 0.179810455 0.182306771
0.187565366 0.199300430 0.229356322
0.348722518
문제 정보

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

출처 ICPC SWERC 2022

평가 및 의견

B. Uniform Chemistry

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

Log in to rate problems.

개별 의견

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

풀이 제출

B. Uniform Chemistry

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