結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー rlangevin
提出日時 2023-02-28 12:31:27
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 491 bytes
コンパイル時間 283 ms
コンパイル使用メモリ 82,260 KB
実行使用メモリ 53,408 KB
最終ジャッジ日時 2024-09-15 14:54:36
合計ジャッジ時間 2,705 ms
ジャッジサーバーID
(参考情報)
judge6 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 27 WA * 3
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
ans = 0
for i in range(N):
    n = input()
    pm = 1
    if n[0] == "-":
        n = n[1:]
        pm = -1
    if "." in n:
        X, Y = n.split(".")
        ans += int(X) * (10 ** 10) * pm
        ans += int(Y + "0" * (10 - len(Y))) * pm
    else:
        ans += int(n) * (10 ** 10) * pm
flag = 0
if ans < 0:
    flag = 1
ans = abs(ans)
X = ans // (10 ** 10)
Y = str(ans % (10 ** 10))
Y += "0" * (10 - len(Y))
S = str(X) + "." + str(Y)
if flag:
    S = "-" + S
print(S)
0