結果

問題 No.81 すべて足すだけの簡単なお仕事です。
コンテスト
ユーザー kazuppa
提出日時 2025-10-18 15:51:55
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 673 bytes
コンパイル時間 391 ms
コンパイル使用メモリ 82,784 KB
実行使用メモリ 54,372 KB
最終ジャッジ日時 2025-10-18 15:52:09
合計ジャッジ時間 3,288 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 16 WA * 14
権限があれば一括ダウンロードができます

ソースコード

diff #

n = int(input())
ans = 0
for i in range(n):
    s = input()
    m = 1
    if s[0] == "-":
        m = -1
        s = s[1:]
    x = 0
    while x < len(s) and s[x] != ".":
        x += 1
    p = 0
    for j in range(x):
        p *= 10
        p += ord(s[j]) - ord("0")
    c = 10
    for j in range(x + 1, len(s)):
        p *= 10
        p += ord(s[j]) - ord("0")
        c -= 1
    while c >= 1:
        c -= 1
        p *= 10
    ans += m * p
l = ans // 10000000000
ans %= 10000000000
s = ""
while len(s) < 10:
    s += chr(ord("0") + ans % 10)
    ans //= 10
s_reversed_list = list(reversed(s))
s_reversed = "".join(list(reversed(s)))
print(l, ".", s_reversed, sep="")
0