結果
| 問題 | No.8072 Sum of sqrt(x) |
| ユーザー |
Kiri8128
|
| 提出日時 | 2020-09-13 23:25:04 |
| 言語 | Python3 (3.14.3 + numpy 2.4.4 + scipy 1.17.1) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 465 bytes |
| 記録 | |
| コンパイル時間 | 1,049 ms |
| コンパイル使用メモリ | 20,828 KB |
| 実行使用メモリ | 156,956 KB |
| 最終ジャッジ日時 | 2026-03-06 00:36:11 |
| 合計ジャッジ時間 | 79,753 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 WA * 1 |
| other | AC * 4 WA * 1 TLE * 22 |
ソースコード
def sqrt(n):
if not n: return 0
x = 1 << (n.bit_length() + 1) // 2
y = (x + n // x) // 2
while y < x:
x = y
y = (x + n // x) // 2
return x | 1
def tostr(n):
a, b = str(n // 10 ** 16), str(n % (10 ** 16))
if len(a) > 15:
return a
return a + "." + b[:16 - len(a)]
N, *X = map(int, open(0).read().split())
s = 0
ANS = []
for x in X:
s += sqrt(x * 10 ** 32)
ANS.append(tostr(s))
print(*ANS, sep = "\n")
Kiri8128