結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー yaoshimaxyaoshimax
提出日時 2015-03-01 20:45:48
言語 Python2
(2.7.18)
結果
WA  
実行時間 -
コード長 486 bytes
コンパイル時間 290 ms
コンパイル使用メモリ 6,752 KB
実行使用メモリ 6,104 KB
最終ジャッジ日時 2023-09-06 05:58:13
合計ジャッジ時間 2,165 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 11 ms
6,040 KB
testcase_01 AC 11 ms
5,936 KB
testcase_02 AC 11 ms
5,856 KB
testcase_03 WA -
testcase_04 AC 12 ms
5,904 KB
testcase_05 AC 11 ms
5,940 KB
testcase_06 WA -
testcase_07 AC 11 ms
5,880 KB
testcase_08 AC 12 ms
6,056 KB
testcase_09 AC 11 ms
5,976 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 AC 11 ms
5,944 KB
testcase_14 AC 11 ms
5,996 KB
testcase_15 AC 12 ms
5,948 KB
testcase_16 AC 11 ms
6,032 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 11 ms
5,944 KB
testcase_26 AC 11 ms
5,944 KB
testcase_27 WA -
testcase_28 AC 11 ms
5,956 KB
testcase_29 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(raw_input())
A=[raw_input().split(".") for i in range(N)]
asum = 0
bsum = 0
for p in A:
    a = int(p[0])
    b = "0"
    if len(p) > 1:
        b = p[1]
    while len(b) < 10:
        b+="0"
    b = int(b)
    if p[0][0]=='-':
        b*=-1
    asum += a
    bsum += b
asum,bsum
while bsum < 0:
    bsum += 10000000000
    asum -= 1
while bsum >= 10000000000:
    bsum -= 10000000000
    asum += 1
bsum = str(bsum)
while len(bsum) < 10:
    bsum += "0"
print str(asum)+"."+bsum

0