結果

問題 No.667 Mice's Luck(ネズミ達の運)
ユーザー はむ吉🐹はむ吉🐹
提出日時 2018-03-23 23:44:11
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 199 ms / 2,000 ms
コード長 486 bytes
コンパイル時間 328 ms
コンパイル使用メモリ 87,236 KB
実行使用メモリ 84,340 KB
最終ジャッジ日時 2023-09-07 04:26:53
合計ジャッジ時間 4,368 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 97 ms
71,544 KB
testcase_01 AC 96 ms
71,540 KB
testcase_02 AC 102 ms
71,628 KB
testcase_03 AC 98 ms
71,616 KB
testcase_04 AC 107 ms
76,360 KB
testcase_05 AC 139 ms
78,232 KB
testcase_06 AC 161 ms
80,528 KB
testcase_07 AC 199 ms
84,276 KB
testcase_08 AC 194 ms
84,148 KB
testcase_09 AC 183 ms
84,340 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env pypy3

import collections


def compute_probs(is_safes):
    ctr = collections.Counter(is_safes)
    num_rest_cells = len(is_safes)
    probs = []
    for is_safe in is_safes:
        prob = ctr["o"] / num_rest_cells
        probs.append(prob)
        ctr[is_safe] -= 1
        num_rest_cells -= 1
    return probs


def main():
    probs = compute_probs(input())
    for prob in probs:
        print("{:.12f}".format(prob * 100))


if __name__ == '__main__':
    main()
0