結果

問題 No.1233 割り切れない気持ち
ユーザー NoneNone
提出日時 2021-03-16 01:42:00
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 407 bytes
コンパイル時間 144 ms
コンパイル使用メモリ 82,560 KB
実行使用メモリ 124,288 KB
最終ジャッジ日時 2024-04-25 04:02:18
合計ジャッジ時間 12,083 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
57,600 KB
testcase_01 AC 41 ms
51,968 KB
testcase_02 AC 43 ms
51,840 KB
testcase_03 AC 53 ms
61,696 KB
testcase_04 AC 55 ms
61,952 KB
testcase_05 AC 39 ms
52,096 KB
testcase_06 AC 37 ms
52,224 KB
testcase_07 AC 89 ms
83,584 KB
testcase_08 AC 114 ms
94,464 KB
testcase_09 AC 148 ms
111,616 KB
testcase_10 AC 156 ms
115,840 KB
testcase_11 AC 86 ms
81,536 KB
testcase_12 AC 169 ms
122,112 KB
testcase_13 AC 167 ms
122,112 KB
testcase_14 AC 170 ms
107,264 KB
testcase_15 AC 178 ms
121,856 KB
testcase_16 AC 177 ms
121,856 KB
testcase_17 AC 88 ms
98,816 KB
testcase_18 AC 139 ms
120,192 KB
testcase_19 AC 110 ms
120,448 KB
testcase_20 AC 84 ms
98,688 KB
testcase_21 AC 112 ms
103,936 KB
testcase_22 AC 113 ms
102,912 KB
testcase_23 AC 113 ms
103,296 KB
testcase_24 AC 111 ms
103,680 KB
testcase_25 AC 110 ms
103,808 KB
testcase_26 AC 110 ms
103,424 KB
testcase_27 AC 417 ms
121,344 KB
testcase_28 AC 395 ms
121,344 KB
testcase_29 AC 373 ms
121,088 KB
testcase_30 AC 347 ms
121,088 KB
testcase_31 AC 328 ms
121,728 KB
testcase_32 AC 323 ms
121,344 KB
testcase_33 AC 311 ms
120,960 KB
testcase_34 AC 312 ms
121,088 KB
testcase_35 AC 297 ms
121,088 KB
testcase_36 AC 433 ms
121,600 KB
testcase_37 AC 42 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
    k=0
    while l+A[i]<=M:
        l+=A[i]
        r+=A[i]
        k+=1
        res-=(C[min2(r+1,M+1)]-C[l])*k*A[i]

print(res)
0