結果

問題 No.1233 割り切れない気持ち
ユーザー NoneNone
提出日時 2021-03-16 01:38:02
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 327 bytes
コンパイル時間 241 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 91,392 KB
最終ジャッジ日時 2024-04-25 03:59:55
合計ジャッジ時間 6,343 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 40 ms
57,600 KB
testcase_01 AC 39 ms
51,968 KB
testcase_02 AC 47 ms
58,624 KB
testcase_03 AC 122 ms
70,784 KB
testcase_04 AC 93 ms
69,120 KB
testcase_05 AC 46 ms
58,240 KB
testcase_06 AC 47 ms
58,240 KB
testcase_07 TLE -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
testcase_12 -- -
testcase_13 -- -
testcase_14 -- -
testcase_15 -- -
testcase_16 -- -
testcase_17 -- -
testcase_18 -- -
testcase_19 -- -
testcase_20 -- -
testcase_21 -- -
testcase_22 -- -
testcase_23 -- -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
testcase_36 -- -
testcase_37 -- -
testcase_38 -- -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

N=int(input())
A=list(map(int, input().split()))
A.sort()
S=[0]*(max(A)+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
    k=0
    while l+A[i]<=max(A):
        l+=A[i]
        r+=A[i]
        k+=1
        res-=(C[min(r+1,max(A)+1)]-C[l])*k*A[i]

print(res)
0