Logo
(追記) (追記ここまで)

24746번 - Pooling PCR Tests 다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 1024 MB108705869.880%

문제

The Polymerase chain reaction (PCR) test is a test for COVID which repeatedly copies a DNA sample and then tests for the presence of COVID specific DNA segments. This can take time and the required reagents may be limited. One suggestion for improving throughput is pooling of samples.

The idea is to combine N samples and run the PCR test on the combined sample. If the test is negative then no further test is required. If the test is positive, all N people must be retested individually. If the probability of a positive test is low, this will significantly reduce the number of tests required.

Write a program which takes as input the probability, p, that a single person tests positive and outputs the optimum number of samples, N, to combine.

If P is the probability that all N people test negative then the expected number of tests, E(T), required is:

E(T) = 1*P + N*(1 – P)

Choose N to minimize E(T) / N.

For example, if N is 2 and p is 0.5, P is 0.25 and E(T) = 0.25 + 2*0.75 = 1.75 which is only slightly less than N.

In order to be sure that the sample from each person is sufficient, N must be no more than 16.

입력

Input consists of a single line containing a single decimal floating point value p, (0 < p < 1), the probability that a single person tests positive for Covid.

출력

Output is a single line containing a single decimal integer. If E(T) ≥ N for all N, output the value 1. Otherwise, the value is N, 2 ≤ N ≤ 16, which minimizes E(T) / N.

제한

예제 입력 1

0.1

예제 출력 1

4

예제 입력 2

0.02

예제 출력 2

8

예제 입력 3

0.01

예제 출력 3

10

힌트

출처

ICPC > Regionals > North America > Greater New York Region > 2021 Greater New York Programming Contest K번

(追記) (追記ここまで)

출처

대학교 대회

  • 사업자 등록 번호: 541-88-00682
  • 대표자명: 최백준
  • 주소: 서울시 서초구 서초대로74길 29 서초파라곤 412호
  • 전화번호: 02-521-0487 (이메일로 연락 주세요)
  • 이메일: contacts@startlink.io
  • 통신판매신고번호: 제 2017-서울서초-2193 호

AltStyle によって変換されたページ (->オリジナル) /