結果

問題 No.3072 Sum of sqrt(x)
ユーザー ShirotsumeShirotsume
提出日時 2023-08-03 01:01:04
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 1,225 bytes
コンパイル時間 3,192 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 93,312 KB
最終ジャッジ日時 2024-04-21 00:46:44
合計ジャッジ時間 68,792 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 54 ms
55,296 KB
testcase_01 AC 54 ms
55,296 KB
testcase_02 AC 53 ms
55,680 KB
testcase_03 AC 50 ms
55,424 KB
testcase_04 AC 50 ms
55,808 KB
testcase_05 AC 49 ms
55,424 KB
testcase_06 AC 49 ms
55,552 KB
testcase_07 WA -
testcase_08 AC 1,049 ms
92,900 KB
testcase_09 AC 1,131 ms
92,940 KB
testcase_10 AC 1,213 ms
93,020 KB
testcase_11 AC 1,688 ms
92,632 KB
testcase_12 WA -
testcase_13 TLE -
testcase_14 AC 1,999 ms
93,200 KB
testcase_15 WA -
testcase_16 WA -
testcase_17 WA -
testcase_18 TLE -
testcase_19 TLE -
testcase_20 WA -
testcase_21 WA -
testcase_22 WA -
testcase_23 TLE -
testcase_24 TLE -
testcase_25 WA -
testcase_26 TLE -
testcase_27 WA -
testcase_28 TLE -
testcase_29 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys, time, random
from collections import deque, Counter, defaultdict
input = lambda: sys.stdin.readline().rstrip()
ii = lambda: int(input())
mi = lambda: map(int, input().split())
li = lambda: list(mi())
inf = 2 ** 63 - 1
mod = 998244353
class fenwick_tree():
    n=1
    data=[0 for i in range(n)]
    def __init__(self,N):
        self.n=N
        self.data=[0 for i in range(N)]

    def add(self,p,x):
        assert 0<=p<self.n,"0<=p<n,p={0},n={1}".format(p,self.n)

        p+=1
        while(p<=self.n):
            self.data[p-1]+=x
            p += p&(-p)
    def sum(self,l,r):
        assert (0<=l and l<=r and r<=self.n),"0<=l<=r<=n,l={0},r={1},n={2}".format(l,r,self.n)
        return self.sum0(r)-self.sum0(l)
    def sum0(self,r):
        s=0
        while(r>0):
            s+=self.data[r-1]
            r-=r&-r
        return s

    def __getitem__(self, p):
        if isinstance(p, int):
            return self.sum(p, p + 1)
        else:
            return self.sum(p.start, p.stop)

    def __setitem__(self, p, x):
        return self.add(p, x - self[p])

    

n = ii()

S = fenwick_tree(n)


for i in range(n):
    x = ii()
    S[i] = x ** 0.5
    
for i in range(1, n + 1):
    print(S[0:i])
0