結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー rpy3cpp
提出日時 2015-07-20 21:18:39
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
RE  
(最新)
AC  
(最初)
実行時間 -
コード長 625 bytes
コンパイル時間 362 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 10,880 KB
最終ジャッジ日時 2024-12-15 00:34:42
合計ジャッジ時間 2,086 ms
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 26 RE * 4
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
cum = 0
for n in range(N):
    a = input()
    if '.' in a:
        a_1, a_2 = a.split('.')
        a1 = int(a_1) * 10**10
        a2 = int(a_2) * 10 ** (10 - len(a_2))
        if a_1.startswith('-'):
            a = a1 - a2
        else:
            a = a1 + a2
    else:
        a = int(a) * 10 ** 10
    cum += a
if abs(cum) < 10**10:
    if cum > 0:
        cum_str = '0' * (11 - len(str(cum))) + str(cum)
    elif cum < 0:
        cum_str = '-' + '0' * (11 - len(str(abs(cum)))) + str(abs(cum))
    else:
        str_cum = '0' * 11
else:
    str_cum = str(cum)
print(str_cum[:-10] + '.' + str_cum[-10:])
0