結果

問題 No.1791 Repeat Multiplication
ユーザー NyaanNyaanNyaanNyaan
提出日時 2021-12-20 10:39:35
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 335 ms / 3,000 ms
コード長 328 bytes
コンパイル時間 1,651 ms
コンパイル使用メモリ 87,008 KB
実行使用メモリ 121,272 KB
最終ジャッジ日時 2023-10-13 19:28:43
合計ジャッジ時間 11,748 ms
ジャッジサーバーID
(参考情報)
judge12 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,192 KB
testcase_01 AC 72 ms
71,532 KB
testcase_02 AC 90 ms
76,372 KB
testcase_03 AC 71 ms
71,532 KB
testcase_04 AC 75 ms
75,780 KB
testcase_05 AC 76 ms
75,688 KB
testcase_06 AC 72 ms
71,464 KB
testcase_07 AC 76 ms
75,784 KB
testcase_08 AC 132 ms
95,696 KB
testcase_09 AC 129 ms
94,668 KB
testcase_10 AC 127 ms
94,828 KB
testcase_11 AC 123 ms
92,580 KB
testcase_12 AC 112 ms
86,276 KB
testcase_13 AC 327 ms
116,308 KB
testcase_14 AC 335 ms
119,636 KB
testcase_15 AC 238 ms
113,220 KB
testcase_16 AC 231 ms
112,904 KB
testcase_17 AC 327 ms
121,272 KB
testcase_18 AC 259 ms
115,516 KB
testcase_19 AC 301 ms
114,208 KB
testcase_20 AC 251 ms
113,860 KB
testcase_21 AC 281 ms
113,292 KB
testcase_22 AC 335 ms
120,904 KB
testcase_23 AC 249 ms
114,032 KB
testcase_24 AC 321 ms
118,652 KB
testcase_25 AC 281 ms
113,752 KB
testcase_26 AC 307 ms
120,556 KB
testcase_27 AC 254 ms
115,404 KB
testcase_28 AC 330 ms
120,504 KB
testcase_29 AC 321 ms
120,488 KB
testcase_30 AC 320 ms
120,520 KB
testcase_31 AC 70 ms
71,304 KB
testcase_32 AC 310 ms
120,600 KB
testcase_33 AC 300 ms
120,712 KB
testcase_34 AC 299 ms
120,492 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N, Q = map(int, input().split())

dp = [0] * (N + 1)
dp[1] = 1
for i in range(1, N + 1):
  for j in range(i + i, N + 1, i):
    dp[j] += dp[i]
rui = [0] * (N + 1)
for i in range(1, N + 1):
  rui[i] = rui[i - 1] + dp[i]

import sys
qs = list(map(int, sys.stdin.read().split()))
print(*[dp[x] * rui[N // x]for x in qs], sep='\n')
0