結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー lloyzlloyz
提出日時 2023-09-05 20:22:03
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 581 bytes
コンパイル時間 1,142 ms
コンパイル使用メモリ 87,232 KB
実行使用メモリ 71,564 KB
最終ジャッジ日時 2023-09-05 20:22:08
合計ジャッジ時間 3,975 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,332 KB
testcase_01 AC 75 ms
71,328 KB
testcase_02 AC 72 ms
71,304 KB
testcase_03 WA -
testcase_04 AC 78 ms
71,352 KB
testcase_05 AC 74 ms
71,304 KB
testcase_06 WA -
testcase_07 AC 73 ms
71,360 KB
testcase_08 AC 75 ms
71,084 KB
testcase_09 AC 75 ms
71,480 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 78 ms
71,500 KB
testcase_14 AC 73 ms
71,076 KB
testcase_15 AC 75 ms
71,304 KB
testcase_16 AC 74 ms
71,080 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 WA -
testcase_24 WA -
testcase_25 AC 76 ms
71,072 KB
testcase_26 AC 72 ms
71,328 KB
testcase_27 WA -
testcase_28 AC 73 ms
71,420 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
i, f = 0, 0
max_f = 10**10
for _ in range(n):
    a = input()
    if '.' in a:
        ai, af = a.split('.')
        ai = int(ai)
        i += ai
        p = 10 - len(af)
        af = int(af)
        if a[0] == '-':
            f -= af * pow(10, p)
            if f < 0:
                i -= 1
                f += max_f
        else:
            f += af * pow(10, p)
            if f >= max_f:
                i += 1
                f -= max_f
    else:
        i += int(a)
i, f = str(i), str(f)
if len(f) < 10:
    f = f + '0' * (10 - len(f))
print(i + '.' + f)
0