結果

問題 No.1791 Repeat Multiplication
ユーザー ripityripity
提出日時 2021-11-27 17:33:04
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 555 ms / 3,000 ms
コード長 282 bytes
コンパイル時間 702 ms
コンパイル使用メモリ 86,908 KB
実行使用メモリ 102,056 KB
最終ジャッジ日時 2023-10-13 19:05:59
合計ジャッジ時間 17,664 ms
ジャッジサーバーID
(参考情報)
judge11 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 77 ms
71,376 KB
testcase_01 AC 75 ms
71,172 KB
testcase_02 AC 86 ms
76,304 KB
testcase_03 AC 77 ms
71,492 KB
testcase_04 AC 88 ms
75,884 KB
testcase_05 AC 87 ms
75,896 KB
testcase_06 AC 78 ms
71,360 KB
testcase_07 AC 84 ms
75,776 KB
testcase_08 AC 316 ms
79,320 KB
testcase_09 AC 291 ms
79,208 KB
testcase_10 AC 292 ms
79,212 KB
testcase_11 AC 277 ms
79,356 KB
testcase_12 AC 208 ms
78,844 KB
testcase_13 AC 528 ms
99,108 KB
testcase_14 AC 544 ms
99,704 KB
testcase_15 AC 434 ms
94,480 KB
testcase_16 AC 433 ms
93,960 KB
testcase_17 AC 555 ms
101,284 KB
testcase_18 AC 470 ms
96,112 KB
testcase_19 AC 517 ms
98,980 KB
testcase_20 AC 440 ms
94,664 KB
testcase_21 AC 507 ms
98,768 KB
testcase_22 AC 538 ms
101,708 KB
testcase_23 AC 437 ms
95,260 KB
testcase_24 AC 531 ms
99,596 KB
testcase_25 AC 493 ms
97,588 KB
testcase_26 AC 510 ms
100,704 KB
testcase_27 AC 429 ms
95,952 KB
testcase_28 AC 503 ms
101,980 KB
testcase_29 AC 505 ms
101,912 KB
testcase_30 AC 508 ms
101,908 KB
testcase_31 AC 71 ms
71,264 KB
testcase_32 AC 508 ms
102,056 KB
testcase_33 AC 491 ms
101,880 KB
testcase_34 AC 491 ms
101,888 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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[N//x])
0