結果
| 問題 |
No.81 すべて足すだけの簡単なお仕事です。
|
| コンテスト | |
| ユーザー |
h_noson
|
| 提出日時 | 2017-01-26 01:45:53 |
| 言語 | Python3 (3.13.1 + numpy 2.2.1 + scipy 1.14.1) |
| 結果 |
AC
|
| 実行時間 | 32 ms / 5,000 ms |
| コード長 | 539 bytes |
| コンパイル時間 | 219 ms |
| コンパイル使用メモリ | 12,544 KB |
| 実行使用メモリ | 10,880 KB |
| 最終ジャッジ日時 | 2024-07-22 16:37:57 |
| 合計ジャッジ時間 | 2,006 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 30 |
ソースコード
from functools import reduce
def convert(x):
s = x.split('.')
if len(s) == 2:
while len(s[1]) < 10:
s[1] += '0'
if s[0][0] == '-':
return int(s[0]) * 10**10 - int(s[1])
else:
return int(s[0]) * 10**10 + int(s[1])
else:
return int(s[0]) * 10**10
n = int(input())
ans = reduce(lambda x,y:x+y,[convert(input()) for i in range(n)])
if ans < 0:
print("-%d.%010d" % (-ans // 10**10, -ans % 10**10))
else:
print("%d.%010d" % (ans // 10**10, ans % 10**10))
h_noson