結果

問題 No.1791 Repeat Multiplication
ユーザー ああいいああいい
提出日時 2022-02-26 10:36:22
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 519 ms / 3,000 ms
コード長 314 bytes
コンパイル時間 431 ms
コンパイル使用メモリ 87,360 KB
実行使用メモリ 101,248 KB
最終ジャッジ日時 2023-09-17 10:22:36
合計ジャッジ時間 14,522 ms
ジャッジサーバーID
(参考情報)
judge15 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 69 ms
71,332 KB
testcase_01 AC 72 ms
71,484 KB
testcase_02 AC 77 ms
76,436 KB
testcase_03 AC 70 ms
71,384 KB
testcase_04 AC 84 ms
75,480 KB
testcase_05 AC 81 ms
75,660 KB
testcase_06 AC 71 ms
71,044 KB
testcase_07 AC 78 ms
71,368 KB
testcase_08 AC 300 ms
79,380 KB
testcase_09 AC 298 ms
79,344 KB
testcase_10 AC 280 ms
79,552 KB
testcase_11 AC 266 ms
79,472 KB
testcase_12 AC 203 ms
79,128 KB
testcase_13 AC 459 ms
99,176 KB
testcase_14 AC 473 ms
99,768 KB
testcase_15 AC 406 ms
94,008 KB
testcase_16 AC 417 ms
93,336 KB
testcase_17 AC 475 ms
100,836 KB
testcase_18 AC 431 ms
97,052 KB
testcase_19 AC 474 ms
98,904 KB
testcase_20 AC 414 ms
94,464 KB
testcase_21 AC 457 ms
98,608 KB
testcase_22 AC 481 ms
100,296 KB
testcase_23 AC 414 ms
94,808 KB
testcase_24 AC 459 ms
99,520 KB
testcase_25 AC 453 ms
97,932 KB
testcase_26 AC 480 ms
99,960 KB
testcase_27 AC 430 ms
96,816 KB
testcase_28 AC 472 ms
101,152 KB
testcase_29 AC 493 ms
101,036 KB
testcase_30 AC 479 ms
100,988 KB
testcase_31 AC 70 ms
71,172 KB
testcase_32 AC 519 ms
100,960 KB
testcase_33 AC 481 ms
100,984 KB
testcase_34 AC 500 ms
101,248 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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

dp = [1] * (N+1)

for i in range(2,N+1):
    for j in range(i*2,N+1,i):
        dp[j] += dp[i]
_sum = [0] * (N+1)
for i in range(1,N+1):
    _sum[i] = _sum[i-1] + dp[i]
    
for _ in range(Q):
    x = int(input())
    ans = 0
    q = N // x
    ans = dp[x] * _sum[q]
    print(ans)
0