結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー しらっ亭しらっ亭
提出日時 2015-10-23 03:13:47
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 539 bytes
コンパイル時間 74 ms
コンパイル使用メモリ 10,880 KB
実行使用メモリ 8,000 KB
最終ジャッジ日時 2023-09-30 05:06:14
合計ジャッジ時間 1,721 ms
ジャッジサーバーID
(参考情報)
judge15 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 WA -
testcase_01 WA -
testcase_02 AC 16 ms
7,752 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 16 ms
7,796 KB
testcase_06 WA -
testcase_07 AC 16 ms
7,860 KB
testcase_08 AC 16 ms
7,860 KB
testcase_09 WA -
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 AC 16 ms
7,852 KB
testcase_16 AC 16 ms
7,884 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 WA -
testcase_26 AC 16 ms
7,856 KB
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

def solve():
    N = int(input())

    sa = sb = 0
    for i in range(N):
        s = input()
        sign = True
        if s[0] == '-':
            s = s[1:]
            sign = False

        a, b = (s + '.').split('.', maxsplit=2)[:2]
        if sign:
            sa += int(a)
            sb += int((b + '000000000000')[:10])
        else:
            sa -= int(a)
            sb -= int((b + '000000000000')[:10])

    sa += sb // 10000000000
    sb %= 10000000000
    print(sa, '.', sb, sep='')

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