結果

問題 No.298 話の伝達
ユーザー sette_pianisette_piani
提出日時 2016-09-27 22:39:46
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 554 bytes
コンパイル時間 188 ms
コンパイル使用メモリ 12,800 KB
実行使用メモリ 11,008 KB
最終ジャッジ日時 2024-05-01 05:50:36
合計ジャッジ時間 4,018 ms
ジャッジサーバーID
(参考情報)
judge3 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 AC 31 ms
10,752 KB
testcase_02 AC 29 ms
10,752 KB
testcase_03 AC 29 ms
10,752 KB
testcase_04 WA -
testcase_05 AC 29 ms
10,752 KB
testcase_06 WA -
testcase_07 AC 29 ms
10,752 KB
testcase_08 AC 29 ms
10,752 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 AC 29 ms
10,752 KB
testcase_12 AC 30 ms
10,752 KB
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 29 ms
10,752 KB
testcase_16 AC 1,435 ms
10,752 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

# coding: utf-8
# Here your code !

# -*- coding: utf-8 -*-
"""
Created on Sun Sep 25 16:13:19 2016

@author: dotha
"""


def red(ll):
    j = 1
    for l in ll:
        j *= (1-l)
    return 1 - j


def counter(to):
    if to == 0:
        return 1
    else:
        return red([counter(t[0])*t[2]*0.01 for t in table if t[1]==to])


if __name__ == '__main__':
    N,M = input().split()
    N=int(N)
    M=int(M)
    
    table=[list(map(int,input().split())) for i in range(M)]
    
    print(red([counter(t[0])*t[2]*0.01 for t in table if t[1]==N-1]))
0