結果

問題 No.1233 割り切れない気持ち
ユーザー persimmon-persimmonpersimmon-persimmon
提出日時 2021-03-04 11:13:14
言語 PyPy3
(7.3.15)
結果
TLE  
実行時間 -
コード長 445 bytes
コンパイル時間 252 ms
コンパイル使用メモリ 82,176 KB
実行使用メモリ 121,856 KB
最終ジャッジ日時 2024-04-15 04:26:01
合計ジャッジ時間 12,410 ms
ジャッジサーバーID
(参考情報)
judge3 / judge5
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
57,472 KB
testcase_01 AC 33 ms
51,840 KB
testcase_02 AC 38 ms
52,480 KB
testcase_03 AC 42 ms
59,904 KB
testcase_04 AC 42 ms
60,928 KB
testcase_05 AC 34 ms
52,096 KB
testcase_06 AC 34 ms
52,224 KB
testcase_07 AC 64 ms
82,176 KB
testcase_08 AC 77 ms
93,952 KB
testcase_09 AC 108 ms
111,360 KB
testcase_10 AC 111 ms
116,040 KB
testcase_11 AC 62 ms
79,872 KB
testcase_12 AC 120 ms
121,472 KB
testcase_13 AC 124 ms
121,344 KB
testcase_14 AC 119 ms
121,344 KB
testcase_15 AC 120 ms
121,472 KB
testcase_16 AC 120 ms
121,472 KB
testcase_17 AC 71 ms
97,664 KB
testcase_18 AC 112 ms
121,216 KB
testcase_19 AC 95 ms
121,856 KB
testcase_20 AC 70 ms
97,664 KB
testcase_21 AC 73 ms
100,608 KB
testcase_22 AC 73 ms
100,352 KB
testcase_23 AC 74 ms
100,480 KB
testcase_24 AC 76 ms
100,992 KB
testcase_25 AC 76 ms
100,480 KB
testcase_26 AC 74 ms
100,992 KB
testcase_27 AC 998 ms
120,320 KB
testcase_28 AC 890 ms
120,576 KB
testcase_29 AC 270 ms
120,576 KB
testcase_30 AC 258 ms
120,748 KB
testcase_31 AC 246 ms
120,448 KB
testcase_32 AC 243 ms
120,448 KB
testcase_33 AC 227 ms
121,200 KB
testcase_34 AC 217 ms
120,736 KB
testcase_35 AC 214 ms
120,804 KB
testcase_36 AC 207 ms
120,704 KB
testcase_37 AC 35 ms
52,352 KB
testcase_38 TLE -
testcase_39 -- -
testcase_40 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

def main1(n,a):
  ret=n*sum(a)
  m=max(a)
  ary=[0]*(m+1)
  for x in a:ary[x]+=1
  sary=[0]
  for x in ary:sary.append(sary[-1]+x)
  for x in a:
    i=1
    while i*x<=m:
      # xで割った商がiになる数字の個数
      # [i*x,(i+1)*x)
      s=i*x
      e=min((i+1)*x,m+1)
      t=sary[e]-sary[s]
      ret-=i*x*t
      i+=1
  return ret
if __name__=='__main__':
  n=int(input())
  a=list(map(int,input().split()))
  print(main1(n,a))
0