結果
| 問題 |
No.3072 Speedrun Query
|
| コンテスト | |
| ユーザー |
gew1fw
|
| 提出日時 | 2025-06-12 20:05:30 |
| 言語 | PyPy3 (7.3.15) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 664 bytes |
| コンパイル時間 | 168 ms |
| コンパイル使用メモリ | 82,164 KB |
| 実行使用メモリ | 80,644 KB |
| 最終ジャッジ日時 | 2025-06-12 20:12:12 |
| 合計ジャッジ時間 | 5,735 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | WA * 1 |
| other | WA * 2 TLE * 1 -- * 18 |
ソースコード
import sys
from decimal import Decimal, getcontext
getcontext().prec = 30 # Set a high precision
def main():
input = sys.stdin.read().split()
n = int(input[0])
x_list = list(map(int, input[1:n+1]))
current_sum = Decimal(0)
sums = []
for x in x_list:
sqrt_x = Decimal(x).sqrt()
current_sum += sqrt_x
sums.append(current_sum)
for s in sums:
s_str = format(s, 'f') # Convert to fixed-point string
# Remove trailing zeros and unnecessary decimal point
if '.' in s_str:
s_str = s_str.rstrip('0').rstrip('.')
print(s_str)
if __name__ == "__main__":
main()
gew1fw