結果

問題 No.1791 Repeat Multiplication
ユーザー KudeKude
提出日時 2021-12-20 20:07:41
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 559 ms / 3,000 ms
コード長 288 bytes
コンパイル時間 679 ms
コンパイル使用メモリ 86,828 KB
実行使用メモリ 101,028 KB
最終ジャッジ日時 2023-10-13 19:34:28
合計ジャッジ時間 15,895 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,172 KB
testcase_01 AC 73 ms
71,232 KB
testcase_02 AC 82 ms
76,388 KB
testcase_03 AC 73 ms
71,236 KB
testcase_04 AC 81 ms
75,448 KB
testcase_05 AC 83 ms
75,516 KB
testcase_06 AC 74 ms
71,236 KB
testcase_07 AC 80 ms
75,700 KB
testcase_08 AC 335 ms
79,192 KB
testcase_09 AC 306 ms
78,972 KB
testcase_10 AC 283 ms
79,460 KB
testcase_11 AC 269 ms
79,184 KB
testcase_12 AC 205 ms
78,872 KB
testcase_13 AC 498 ms
98,956 KB
testcase_14 AC 513 ms
99,808 KB
testcase_15 AC 411 ms
93,616 KB
testcase_16 AC 419 ms
93,336 KB
testcase_17 AC 534 ms
100,596 KB
testcase_18 AC 458 ms
96,760 KB
testcase_19 AC 492 ms
98,956 KB
testcase_20 AC 430 ms
94,344 KB
testcase_21 AC 487 ms
98,468 KB
testcase_22 AC 532 ms
100,688 KB
testcase_23 AC 429 ms
94,904 KB
testcase_24 AC 482 ms
99,368 KB
testcase_25 AC 448 ms
97,960 KB
testcase_26 AC 505 ms
99,864 KB
testcase_27 AC 457 ms
96,744 KB
testcase_28 AC 539 ms
101,028 KB
testcase_29 AC 559 ms
100,820 KB
testcase_30 AC 520 ms
100,764 KB
testcase_31 AC 74 ms
71,480 KB
testcase_32 AC 506 ms
100,896 KB
testcase_33 AC 490 ms
100,924 KB
testcase_34 AC 495 ms
101,016 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

n, q = map(int, input().split())
d = [0] * (n + 1)
d[1] = 1
for i in range(1, n):
    v = d[i]
    for j in range(2 * i, n + 1, i):
        d[j] += v
s = [0] * (n + 1)
for i in range(1, n + 1):
    s[i] = s[i - 1] + d[i]
for _ in range(q):
    x = int(input())
    print(d[x] * s[n // x])
0