結果

問題 No.313 π
ユーザー はむ吉🐹
提出日時 2015-12-07 17:22:14
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
AC  
実行時間 50 ms / 5,000 ms
コード長 678 bytes
コンパイル時間 124 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 11,136 KB
最終ジャッジ日時 2024-09-14 18:27:35
合計ジャッジ時間 2,923 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 32
権限があれば一括ダウンロードができます

ソースコード

diff #

#!/usr/bin/env python3
# -*- coding: utf-8 -*-

import collections
import string

PI200K = {'0': 20104,
          '1': 20063,
          '2': 19892,
          '3': 20011,
          '4': 19874,
          '5': 20199,
          '6': 19898,
          '7': 20163,
          '8': 19956,
          '9': 19841}


def compare_strings(wrong, correct=PI200K):
    wrong_counter = collections.Counter(wrong)
    for d in string.digits:
        if PI200K[d] < wrong_counter[d]:
            before = d
        elif PI200K[d] > wrong_counter[d]:
            after = d
    return [before, after]


def main():
    print(" ".join(compare_strings(input())))

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