結果

問題 No.81 すべて足すだけの簡単なお仕事です。
ユーザー human_cipherhuman_cipher
提出日時 2022-01-09 00:35:32
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
WA  
実行時間 -
コード長 726 bytes
コンパイル時間 189 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 10,752 KB
最終ジャッジ日時 2024-04-26 19:40:38
合計ジャッジ時間 1,864 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

n = int(input())
ans = 0
A = [input() for _ in range(n)]
for i in range(n):
    if A[i].find(".") == -1: #小数点なし
        ans += int(A[i]) * 10**10
    else:
        pt = A[i].find(".")
        floatdigit = len(A[i]) - pt - 1
        A[i] = A[i].replace(".","")
        if A[i][0] == "-":
            A[i] = "-" + str(int(A[i][1:] + "0" * (10-floatdigit)))
        else:
            A[i] = str(int(A[i] + "0" * (10-floatdigit)))
        ans += int(A[i])
ans = str(ans)
if ans[0] == "-":
    ans = ans[:len(ans)-9] + "." + ans[len(ans)-9:]
else:
    ans = ans[:len(ans)-10] + "." + ans[len(ans)-10:]
if ans.find(".") == 0:
    ans = "0" + ans
if ans.find(".") == 1 and ans[0] == "-":
    ans = "-0" + ans[1:]
print(ans)
0