結果

問題 No.1791 Repeat Multiplication
ユーザー ripityripity
提出日時 2021-11-21 15:56:03
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 568 ms / 3,000 ms
コード長 306 bytes
コンパイル時間 1,743 ms
コンパイル使用メモリ 86,988 KB
実行使用メモリ 102,316 KB
最終ジャッジ日時 2023-10-13 19:04:28
合計ジャッジ時間 16,537 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,392 KB
testcase_01 AC 73 ms
71,048 KB
testcase_02 AC 81 ms
76,284 KB
testcase_03 AC 75 ms
71,344 KB
testcase_04 AC 81 ms
75,836 KB
testcase_05 AC 84 ms
75,804 KB
testcase_06 AC 76 ms
71,232 KB
testcase_07 AC 83 ms
75,820 KB
testcase_08 AC 307 ms
79,440 KB
testcase_09 AC 283 ms
79,180 KB
testcase_10 AC 286 ms
79,436 KB
testcase_11 AC 269 ms
79,320 KB
testcase_12 AC 208 ms
79,076 KB
testcase_13 AC 542 ms
99,460 KB
testcase_14 AC 527 ms
99,996 KB
testcase_15 AC 432 ms
94,596 KB
testcase_16 AC 426 ms
94,348 KB
testcase_17 AC 532 ms
101,480 KB
testcase_18 AC 473 ms
96,324 KB
testcase_19 AC 539 ms
99,068 KB
testcase_20 AC 456 ms
94,648 KB
testcase_21 AC 494 ms
99,256 KB
testcase_22 AC 547 ms
102,000 KB
testcase_23 AC 443 ms
95,416 KB
testcase_24 AC 526 ms
99,756 KB
testcase_25 AC 500 ms
98,328 KB
testcase_26 AC 553 ms
101,336 KB
testcase_27 AC 464 ms
96,176 KB
testcase_28 AC 558 ms
102,036 KB
testcase_29 AC 558 ms
102,084 KB
testcase_30 AC 568 ms
102,076 KB
testcase_31 AC 73 ms
71,420 KB
testcase_32 AC 545 ms
102,072 KB
testcase_33 AC 558 ms
102,316 KB
testcase_34 AC 563 ms
102,072 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

import math

N,Q = map(int,input().split())
dp = [0]*(N+1);
sum = [0]*(N+1)
dp[1] = 1;
for i in range(1,N+1):
    sum[i] = dp[i]+sum[i-1]
    for j in range(2,N+1):
        if i*j > N:
            break
        dp[i*j] += dp[i]

for i in range(Q):
    x = int(input())
    print(dp[x]*sum[math.floor(N/x)])
0