結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 37 ms
57,984 KB
testcase_01 AC 36 ms
51,712 KB
testcase_02 AC 39 ms
52,352 KB
testcase_03 AC 58 ms
61,312 KB
testcase_04 AC 48 ms
61,312 KB
testcase_05 AC 38 ms
52,224 KB
testcase_06 AC 36 ms
52,096 KB
testcase_07 AC 84 ms
82,432 KB
testcase_08 AC 104 ms
93,824 KB
testcase_09 AC 148 ms
112,640 KB
testcase_10 AC 155 ms
117,120 KB
testcase_11 AC 85 ms
80,384 KB
testcase_12 AC 183 ms
123,136 KB
testcase_13 AC 173 ms
123,520 KB
testcase_14 AC 168 ms
108,672 KB
testcase_15 AC 167 ms
122,752 KB
testcase_16 AC 178 ms
123,008 KB
testcase_17 AC 84 ms
98,432 KB
testcase_18 AC 135 ms
121,344 KB
testcase_19 AC 115 ms
121,728 KB
testcase_20 AC 84 ms
99,072 KB
testcase_21 AC 127 ms
104,192 KB
testcase_22 AC 112 ms
103,808 KB
testcase_23 AC 114 ms
104,192 KB
testcase_24 AC 112 ms
104,320 KB
testcase_25 AC 110 ms
104,192 KB
testcase_26 AC 113 ms
104,192 KB
testcase_27 AC 435 ms
122,368 KB
testcase_28 AC 407 ms
121,728 KB
testcase_29 AC 387 ms
121,984 KB
testcase_30 AC 368 ms
122,112 KB
testcase_31 AC 351 ms
122,240 KB
testcase_32 AC 341 ms
122,240 KB
testcase_33 AC 323 ms
121,856 KB
testcase_34 AC 323 ms
122,240 KB
testcase_35 AC 310 ms
122,112 KB
testcase_36 AC 397 ms
122,496 KB
testcase_37 AC 38 ms
51,968 KB
testcase_38 TLE -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

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