結果
| 問題 | 
                            No.8072 Sum of sqrt(x)
                             | 
                    
| ユーザー | 
                             maspy
                         | 
                    
| 提出日時 | 2020-06-21 11:14:33 | 
| 言語 | Python3  (3.13.1 + numpy 2.2.1 + scipy 1.14.1)  | 
                    
| 結果 | 
                             
                                TLE
                                 
                             
                            
                            (最新)
                                AC
                                 
                             
                            (最初)
                            
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 625 bytes | 
| コンパイル時間 | 223 ms | 
| コンパイル使用メモリ | 12,672 KB | 
| 実行使用メモリ | 199,736 KB | 
| 最終ジャッジ日時 | 2024-06-29 19:38:17 | 
| 合計ジャッジ時間 | 58,168 ms | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge2 / judge1 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 3 | 
| other | AC * 8 TLE * 19 | 
ソースコード
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