結果
問題 |
No.1233 割り切れない気持ち
|
ユーザー |
![]() |
提出日時 | 2020-09-21 22:35:40 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 873 ms / 3,153 ms |
コード長 | 820 bytes |
コンパイル時間 | 230 ms |
コンパイル使用メモリ | 82,844 KB |
実行使用メモリ | 111,120 KB |
最終ジャッジ日時 | 2024-06-24 21:26:10 |
合計ジャッジ時間 | 14,076 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 39 |
ソースコード
from bisect import bisect_left, bisect_right def cnt_quotient(Number, quioitent, List): return len(List) - bisect_right(List, Number*quioitent-1) def main(): N = int(input()) a = list(map(int, input().split())) a.sort() res = 0 s = sum(a) visited = [False for i in range(2*10**5+1)] val = [0 for i in range(2*10**5+1)] for v in a: if visited[v] == True: res += val[v] continue else: visited[v] = True tmp_sum = s for i in range(1, 2*10**5+1): if v*i > 2*10**5: break else: tmp_sum -= v*cnt_quotient(v, i, a) res += tmp_sum val[v] = tmp_sum print(res) return if __name__ == "__main__": main()