結果

問題 No.1233 割り切れない気持ち
ユーザー marroncastlemarroncastle
提出日時 2020-09-18 23:14:45
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 151 ms / 3,153 ms
コード長 310 bytes
コンパイル時間 399 ms
コンパイル使用メモリ 86,760 KB
実行使用メモリ 110,428 KB
最終ジャッジ日時 2023-09-04 21:56:51
合計ジャッジ時間 7,027 ms
ジャッジサーバーID
(参考情報)
judge12 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 74 ms
71,004 KB
testcase_01 AC 74 ms
71,044 KB
testcase_02 AC 74 ms
70,988 KB
testcase_03 AC 85 ms
75,500 KB
testcase_04 AC 84 ms
75,872 KB
testcase_05 AC 76 ms
70,940 KB
testcase_06 AC 75 ms
70,864 KB
testcase_07 AC 106 ms
83,344 KB
testcase_08 AC 110 ms
89,520 KB
testcase_09 AC 134 ms
102,636 KB
testcase_10 AC 141 ms
105,896 KB
testcase_11 AC 96 ms
82,400 KB
testcase_12 AC 148 ms
110,060 KB
testcase_13 AC 151 ms
110,188 KB
testcase_14 AC 146 ms
109,760 KB
testcase_15 AC 147 ms
109,772 KB
testcase_16 AC 150 ms
110,180 KB
testcase_17 AC 107 ms
103,832 KB
testcase_18 AC 146 ms
110,080 KB
testcase_19 AC 124 ms
110,428 KB
testcase_20 AC 108 ms
104,096 KB
testcase_21 AC 111 ms
105,088 KB
testcase_22 AC 110 ms
105,308 KB
testcase_23 AC 112 ms
105,136 KB
testcase_24 AC 112 ms
105,244 KB
testcase_25 AC 112 ms
105,212 KB
testcase_26 AC 112 ms
105,280 KB
testcase_27 AC 126 ms
109,256 KB
testcase_28 AC 126 ms
109,256 KB
testcase_29 AC 125 ms
109,204 KB
testcase_30 AC 125 ms
109,292 KB
testcase_31 AC 125 ms
109,292 KB
testcase_32 AC 125 ms
109,288 KB
testcase_33 AC 123 ms
109,300 KB
testcase_34 AC 124 ms
109,252 KB
testcase_35 AC 126 ms
109,256 KB
testcase_36 AC 129 ms
109,296 KB
testcase_37 AC 75 ms
71,028 KB
testcase_38 AC 116 ms
107,272 KB
testcase_39 AC 141 ms
108,672 KB
testcase_40 AC 137 ms
108,724 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N = int(input())
A = list(map(int, input().split()))
ans = sum(A)*N
M = max(A)
lis = [0]*(M+1)
cum = [0]*(M+1)
for a in A:
  lis[a] += 1
for i in range(1,M+1):
  cum[i] = cum[i-1]+lis[i]

for i in range(1,M+1):
  if lis[i]==0:
    continue
  for p in range(i,M+1,i):
    ans -= lis[i]*i*(N-cum[p-1])
print(ans)
0