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

26030번 - Graduation Guarantee 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
1 초 (추가 시간 없음) 1024 MB76484572.581%

문제

Gustav is studying to become an interpreter. In this line of work, knowing several languages is a must, and Gustav is already fluent in French, Mandarin, Nahuatl and even Finnish. But there is one language that Gustav struggles with: Norwegian. Before Gustav can graduate, he must complete the infamous Norwegian Conclusive Proficiency Check.

This exam consists of $n$ yes/no questions. Answering correctly gives $+1$ point, answering incorrectly gives $-1$ point, and not answering gives 0ドル$ points. To pass the exam, at least $k$ points are needed. For each question, Gustav has a guess that he knows is correct with probability $p_i$ (0ドル.5 \leq p_i \leq 1$). Note that $p_i \geq 0.5,ドル because otherwise guessing the opposite would be better.

What is the maximum possible probability of passing the exam, assuming we carefully choose which questions to answer and which ones to leave unanswered? Note that unlike a programming contest, the exam does not have instant feedback. So Gustav will answer the questions, hand in his answers, and only later be told the results.

입력

The first line contains the two integers $n$ and $k$ (1ドル \leq k \leq n \leq 5000$). The second line contains $n$ real numbers $p_i$ (0ドル.5 \leq p_i \leq 1.0$). These numbers will have at most 6ドル$ digits after the decimal point.

출력

Output the probability that we pass the exam. Your answer will be considered correct if it has an absolute or relative error of at most 10ドル^{-6}$.

제한

예제 입력 1

3 3
0.5 0.5 0.5

예제 출력 1

0.125

예제 입력 2

4 1
0.9 0.5 0.9 0.9

예제 출력 2

0.972

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Nordic Collegiate Programming Contest > NCPC 2022 G번

  • 문제를 만든 사람: Per Austrin
(追記) (追記ここまで)

출처

대학교 대회

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

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