結果
問題 | No.81 すべて足すだけの簡単なお仕事です。 |
ユーザー |
![]() |
提出日時 | 2023-02-28 12:39:29 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 42 ms / 5,000 ms |
コード長 | 494 bytes |
コンパイル時間 | 424 ms |
コンパイル使用メモリ | 81,920 KB |
実行使用メモリ | 52,352 KB |
最終ジャッジ日時 | 2024-09-15 15:01:42 |
合計ジャッジ時間 | 3,075 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 30 |
ソースコード
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)) + Y S = str(X) + "." + str(Y) if flag: S = "-" + S print(S)