結果

問題 No.1791 Repeat Multiplication
ユーザー ramdosramdos
提出日時 2021-11-28 18:48:59
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 532 ms / 3,000 ms
コード長 278 bytes
コンパイル時間 1,716 ms
コンパイル使用メモリ 86,296 KB
実行使用メモリ 101,952 KB
最終ジャッジ日時 2023-10-13 19:07:47
合計ジャッジ時間 14,727 ms
ジャッジサーバーID
(参考情報)
judge14 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,328 KB
testcase_01 AC 75 ms
71,260 KB
testcase_02 AC 84 ms
76,160 KB
testcase_03 AC 76 ms
71,332 KB
testcase_04 AC 85 ms
75,672 KB
testcase_05 AC 87 ms
75,800 KB
testcase_06 AC 78 ms
71,356 KB
testcase_07 AC 84 ms
75,732 KB
testcase_08 AC 317 ms
78,684 KB
testcase_09 AC 296 ms
79,036 KB
testcase_10 AC 287 ms
79,024 KB
testcase_11 AC 271 ms
79,168 KB
testcase_12 AC 211 ms
78,720 KB
testcase_13 AC 524 ms
99,180 KB
testcase_14 AC 532 ms
99,656 KB
testcase_15 AC 450 ms
94,384 KB
testcase_16 AC 425 ms
93,840 KB
testcase_17 AC 506 ms
101,108 KB
testcase_18 AC 439 ms
95,904 KB
testcase_19 AC 497 ms
98,956 KB
testcase_20 AC 415 ms
94,400 KB
testcase_21 AC 469 ms
98,568 KB
testcase_22 AC 469 ms
101,372 KB
testcase_23 AC 415 ms
95,152 KB
testcase_24 AC 477 ms
99,580 KB
testcase_25 AC 442 ms
97,984 KB
testcase_26 AC 470 ms
101,084 KB
testcase_27 AC 425 ms
95,848 KB
testcase_28 AC 494 ms
101,492 KB
testcase_29 AC 498 ms
101,808 KB
testcase_30 AC 485 ms
101,952 KB
testcase_31 AC 72 ms
71,352 KB
testcase_32 AC 493 ms
101,808 KB
testcase_33 AC 510 ms
101,832 KB
testcase_34 AC 501 ms
101,920 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q = map(int,input().split())
dp = [0]*(N+1);
su = [0]*(N+1)
dp[1] = 1;
for i in range(1,N+1):
    su[i] = dp[i]+su[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]*su[N//x])
0