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

32600번 - Failing Factory 스페셜 저지다국어

시간 제한메모리 제한제출정답맞힌 사람정답 비율
4 초 1024 MB86372736.986%

문제

The gigafactory for your new range of Battery-Assisted Postal Cars is finally up and running. This manufacturing plant is a highly complex facility, consisting of many individual steps, where the parts of each car are milled, stamped, welded, soldered, screwed, glued, assembled, tested, detailed, layered, painted, and cleaned. Every step is optimized to the tiniest detail, making them very complicated.

As you are preparing for a visit from your main investor, alarm bells start going off. One of the steps failed, causing a cascade of failures across the factory! After hurriedly resolving the failures, panic creeps up to you: what if a failure happens during the visit of the investor?

Currently, all processes in the factory are working, but your engineers determined that each of them has some independent probability of failing before the visit. As the visit is soon, there will be no time for any repairs, and as soon as a step fails, this will quickly halt all dependent steps as well.

Thus, you decide to show only a single processing step of your factory, and specifically, the one with the smallest probability of failing. As an example, consider the second sample case. The probability that step 1ドル$ fails is 0ドル.72,ドル but step 2ドル$ is slightly more stable with a failure probability of 0ドル.6$. Thus, you show step 2ドル$ to your investor, with a probability of 0ドル.4$ that it will not fail.

입력

The input consists of:

  • One line with two integers $n$ and $m$ (1ドル \leq n \leq 10^5,ドル 0ドル \leq m \leq 10^5$), the number of steps and the number of dependencies between steps.
  • One line with $n$ floating point numbers $p$ (0ドル \leq p \leq 1$), the individual failure probability of each step. Each probability is given in decimal form1 with exactly three digits after the decimal point.
  • $m$ lines, each with two integers $a$ and $b$ (1ドル \leq a, b \leq n,ドル $a \neq b$), indicating that step $a$ depends on step $b$: failure of step $b$ will cause failure of step $a$. A direct dependency of one step on another occurs at most once. Cyclic dependencies are allowed.

1When a floating-point number is written in decimal form, it is not in scientific notation.

출력

For the step with the smallest probability of failing, output the probability that it will not fail.

Your answer should have an absolute error of at most 10ドル^{-200}$ or a relative error of at most 10ドル^{-6}$.

제한

예제 입력 1

2 2
0.600 0.300
1 2
2 1

예제 출력 1

0.28

예제 입력 2

2 1
0.300 0.600
1 2

예제 출력 2

0.4

예제 입력 3

4 3
0.999 0.994 0.998 0.996
1 2
2 3
3 4

예제 출력 3

0.004

예제 입력 4

4 4
0.999 0.994 0.998 0.996
1 2
2 3
3 4
4 1

예제 출력 4

4.8e-11

힌트

출처

ICPC > Regionals > Europe > Northwestern European Regional Contest > Benelux Algorithm Programming Contest > BAPC 2024 F번

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

출처

대학교 대회

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

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