結果

問題 No.1233 割り切れない気持ち
ユーザー tktk_snsntktk_snsn
提出日時 2022-06-06 22:17:03
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 447 bytes
コンパイル時間 165 ms
コンパイル使用メモリ 81,616 KB
実行使用メモリ 107,984 KB
最終ジャッジ日時 2023-10-21 03:42:45
合計ジャッジ時間 12,572 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 43 ms
53,400 KB
testcase_01 AC 42 ms
53,272 KB
testcase_02 AC 43 ms
55,320 KB
testcase_03 AC 54 ms
63,740 KB
testcase_04 AC 53 ms
63,740 KB
testcase_05 AC 43 ms
55,320 KB
testcase_06 AC 42 ms
55,320 KB
testcase_07 AC 82 ms
80,132 KB
testcase_08 AC 95 ms
89,564 KB
testcase_09 AC 122 ms
100,400 KB
testcase_10 AC 126 ms
103,660 KB
testcase_11 AC 75 ms
79,000 KB
testcase_12 AC 139 ms
107,660 KB
testcase_13 AC 134 ms
107,660 KB
testcase_14 AC 136 ms
107,660 KB
testcase_15 AC 138 ms
107,660 KB
testcase_16 AC 139 ms
107,660 KB
testcase_17 AC 86 ms
100,452 KB
testcase_18 AC 132 ms
107,660 KB
testcase_19 AC 108 ms
107,984 KB
testcase_20 AC 85 ms
100,448 KB
testcase_21 AC 91 ms
102,960 KB
testcase_22 AC 91 ms
102,972 KB
testcase_23 AC 91 ms
102,988 KB
testcase_24 AC 91 ms
103,000 KB
testcase_25 AC 91 ms
103,012 KB
testcase_26 AC 92 ms
103,032 KB
testcase_27 AC 688 ms
106,876 KB
testcase_28 AC 360 ms
106,816 KB
testcase_29 AC 339 ms
106,816 KB
testcase_30 AC 318 ms
106,816 KB
testcase_31 AC 309 ms
106,816 KB
testcase_32 AC 293 ms
106,816 KB
testcase_33 AC 277 ms
106,816 KB
testcase_34 AC 269 ms
106,816 KB
testcase_35 AC 262 ms
106,816 KB
testcase_36 AC 252 ms
106,816 KB
testcase_37 AC 43 ms
53,272 KB
testcase_38 TLE -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

from collections import Counter

N = int(input())
A = list(map(int, input().split()))
U = max(A)
S = sum(A)

B = [0] * (U + 1)
for a in A:
    B[a] += 1
for i in range(1, U+1):
    B[i] += B[i-1]

G = 0
for a in A:
    F = 0
    for i in range(1, U+1):
        L = i * a - 1
        R = (i + 1) * a - 1
        L = min(U, L)
        R = min(U, R)
        F += i * (B[R] - B[L])
        if R == U:
            break
    G += F * a

print(N * S - G)
0