結果

問題 No.1791 Repeat Multiplication
ユーザー とりゐとりゐ
提出日時 2021-12-20 02:48:38
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 518 ms / 3,000 ms
コード長 213 bytes
コンパイル時間 1,288 ms
コンパイル使用メモリ 87,060 KB
実行使用メモリ 101,348 KB
最終ジャッジ日時 2023-10-13 19:21:44
合計ジャッジ時間 15,385 ms
ジャッジサーバーID
(参考情報)
judge12 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 72 ms
71,328 KB
testcase_01 AC 70 ms
71,440 KB
testcase_02 AC 79 ms
76,092 KB
testcase_03 AC 72 ms
71,228 KB
testcase_04 AC 79 ms
75,564 KB
testcase_05 AC 79 ms
75,476 KB
testcase_06 AC 73 ms
71,348 KB
testcase_07 AC 79 ms
75,532 KB
testcase_08 AC 304 ms
79,356 KB
testcase_09 AC 283 ms
79,500 KB
testcase_10 AC 277 ms
79,188 KB
testcase_11 AC 266 ms
79,360 KB
testcase_12 AC 202 ms
79,004 KB
testcase_13 AC 472 ms
99,196 KB
testcase_14 AC 496 ms
99,756 KB
testcase_15 AC 415 ms
93,796 KB
testcase_16 AC 422 ms
93,428 KB
testcase_17 AC 518 ms
100,420 KB
testcase_18 AC 447 ms
96,944 KB
testcase_19 AC 489 ms
98,956 KB
testcase_20 AC 430 ms
94,548 KB
testcase_21 AC 453 ms
98,936 KB
testcase_22 AC 505 ms
100,408 KB
testcase_23 AC 416 ms
94,824 KB
testcase_24 AC 457 ms
99,632 KB
testcase_25 AC 451 ms
97,824 KB
testcase_26 AC 500 ms
100,068 KB
testcase_27 AC 430 ms
96,784 KB
testcase_28 AC 505 ms
101,088 KB
testcase_29 AC 502 ms
101,236 KB
testcase_30 AC 500 ms
101,348 KB
testcase_31 AC 71 ms
71,492 KB
testcase_32 AC 501 ms
101,100 KB
testcase_33 AC 500 ms
101,020 KB
testcase_34 AC 501 ms
101,232 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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