結果
| 問題 | No.8072 Sum of sqrt(x) |
| ユーザー |
maspy
|
| 提出日時 | 2020-06-21 11:14:33 |
| 言語 | Python3 (3.15.2 + numpy 2.5.4 + scipy 1.18.1 + ACL) |
| 結果 |
WA
不安定
(最新)
AC
(最初)
|
| 実行時間 | - |
| コード長 | 625 bytes |
| 記録 | |
| コンパイル時間 | 207 ms |
| コンパイル使用メモリ | 14,976 KB |
| 実行使用メモリ | 190,844 KB |
| 最終ジャッジ日時 | 2026-11-23 00:18:24 |
| 合計ジャッジ時間 | 124,309 ms |
|
ジャッジサーバーID (参考情報) |
judge5_0 / judge1_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 28 WA * 1 |
ソースコード
import sys
import numpy as np
read = sys.stdin.buffer.read
readline = sys.stdin.buffer.readline
readlines = sys.stdin.buffer.readlines
nums = np.array(read().split(), np.float64)[1:]
np.sqrt(nums, out=nums)
integer = nums.astype(np.int64)
frac = nums - integer
np.cumsum(integer, out=integer)
k = np.searchsorted(integer, 2 ** 32)
x = np.empty_like(frac)
frac_1, frac_2 = np.divmod(frac[:k], 0.5 ** 20)
np.cumsum(frac_1, out=frac_1)
np.cumsum(frac_2, out=frac_2)
x[:k] = frac_1 * (0.5 ** 20) + frac_2
if 0<k<len(nums)-1:
frac[k] += x[k - 1]
x[k:] = frac[k:].cumsum()
x += integer
print('\n'.join(map(str, x.tolist())))
maspy