結果

問題 No.1233 割り切れない気持ち
ユーザー NoneNone
提出日時 2021-03-16 01:45:20
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 414 bytes
コンパイル時間 645 ms
コンパイル使用メモリ 82,304 KB
実行使用メモリ 170,624 KB
最終ジャッジ日時 2024-04-25 04:04:58
合計ジャッジ時間 14,062 ms
ジャッジサーバーID
(参考情報)
judge2 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 44 ms
170,624 KB
testcase_01 AC 48 ms
51,712 KB
testcase_02 AC 44 ms
52,224 KB
testcase_03 AC 64 ms
62,080 KB
testcase_04 AC 61 ms
62,336 KB
testcase_05 AC 42 ms
51,968 KB
testcase_06 AC 40 ms
52,352 KB
testcase_07 AC 100 ms
86,400 KB
testcase_08 AC 120 ms
94,848 KB
testcase_09 AC 157 ms
111,232 KB
testcase_10 AC 166 ms
116,224 KB
testcase_11 AC 96 ms
84,736 KB
testcase_12 AC 183 ms
121,856 KB
testcase_13 AC 180 ms
122,496 KB
testcase_14 AC 179 ms
107,392 KB
testcase_15 AC 180 ms
121,728 KB
testcase_16 AC 178 ms
121,856 KB
testcase_17 AC 89 ms
98,944 KB
testcase_18 AC 148 ms
120,320 KB
testcase_19 AC 118 ms
120,576 KB
testcase_20 AC 91 ms
98,560 KB
testcase_21 AC 121 ms
104,192 KB
testcase_22 AC 121 ms
104,192 KB
testcase_23 AC 120 ms
103,808 KB
testcase_24 AC 120 ms
104,576 KB
testcase_25 AC 122 ms
104,064 KB
testcase_26 AC 122 ms
104,192 KB
testcase_27 AC 457 ms
121,472 KB
testcase_28 AC 418 ms
120,832 KB
testcase_29 AC 405 ms
121,216 KB
testcase_30 AC 374 ms
121,088 KB
testcase_31 AC 364 ms
121,344 KB
testcase_32 AC 355 ms
120,960 KB
testcase_33 AC 338 ms
121,216 KB
testcase_34 AC 334 ms
121,088 KB
testcase_35 AC 316 ms
120,960 KB
testcase_36 AC 525 ms
121,472 KB
testcase_37 AC 39 ms
52,096 KB
testcase_38 TLE -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def min2(x,y):
    return x if x < y else y


import sys
input = sys.stdin.readline

N=int(input())
A=list(map(int, input().split()))
A.sort()
M=max(A)
S=[0]*(M+1)
for a in A:
    S[a]+=1
C=[0]
for a in S:
    C.append(C[-1]+a)

res=N*sum(A)
for i in range(N):
    l,r=0,A[i]-1
    for k in range(1,M+1):
        l+=A[i]
        r+=A[i]
        if l>M: break
        res-=(C[min2(r+1,M+1)]-C[l])*k*A[i]

print(res)
0