結果

問題 No.81 すべて足すだけの簡単なお仕事です。
コンテスト
ユーザー h_noson
提出日時 2017-01-26 01:45:53
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
AC  
実行時間 164 ms / 5,000 ms
コード長 539 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 587 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 15,488 KB
最終ジャッジ日時 2026-04-03 10:04:15
合計ジャッジ時間 6,951 ms
ジャッジサーバーID
(参考情報)
judge5_0 / judge4_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 30
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

from functools import reduce

def convert(x):
    s = x.split('.')
    if len(s) == 2:
        while len(s[1]) < 10:
            s[1] += '0'
        if s[0][0] == '-':
            return int(s[0]) * 10**10 - int(s[1])
        else:
            return int(s[0]) * 10**10 + int(s[1])
    else:
        return int(s[0]) * 10**10

n = int(input())
ans = reduce(lambda x,y:x+y,[convert(input()) for i in range(n)])
if ans < 0:
    print("-%d.%010d" % (-ans // 10**10, -ans % 10**10))
else:
    print("%d.%010d" % (ans // 10**10, ans % 10**10))
0