結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
51,584 KB
testcase_01 AC 38 ms
52,096 KB
testcase_02 AC 37 ms
52,480 KB
testcase_03 AC 55 ms
61,312 KB
testcase_04 AC 50 ms
61,312 KB
testcase_05 AC 37 ms
52,352 KB
testcase_06 AC 42 ms
52,480 KB
testcase_07 AC 88 ms
82,176 KB
testcase_08 AC 104 ms
93,696 KB
testcase_09 AC 153 ms
111,488 KB
testcase_10 AC 160 ms
116,352 KB
testcase_11 AC 80 ms
80,256 KB
testcase_12 AC 171 ms
121,856 KB
testcase_13 AC 174 ms
122,240 KB
testcase_14 AC 166 ms
107,392 KB
testcase_15 AC 169 ms
121,728 KB
testcase_16 AC 171 ms
121,856 KB
testcase_17 AC 82 ms
98,688 KB
testcase_18 AC 137 ms
120,064 KB
testcase_19 AC 116 ms
120,576 KB
testcase_20 AC 83 ms
98,304 KB
testcase_21 AC 110 ms
103,424 KB
testcase_22 AC 110 ms
103,040 KB
testcase_23 AC 112 ms
103,424 KB
testcase_24 AC 112 ms
103,552 KB
testcase_25 AC 113 ms
103,424 KB
testcase_26 AC 112 ms
103,424 KB
testcase_27 AC 436 ms
121,472 KB
testcase_28 AC 404 ms
121,088 KB
testcase_29 AC 390 ms
121,088 KB
testcase_30 AC 366 ms
120,960 KB
testcase_31 AC 355 ms
121,728 KB
testcase_32 AC 340 ms
120,960 KB
testcase_33 AC 325 ms
120,832 KB
testcase_34 AC 314 ms
121,088 KB
testcase_35 AC 321 ms
121,088 KB
testcase_36 AC 398 ms
121,728 KB
testcase_37 AC 36 ms
51,968 KB
testcase_38 TLE -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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[min(r+1,M+1)]-C[l])*k*A[i]

print(res)
0