結果

問題 No.1791 Repeat Multiplication
ユーザー とりゐとりゐ
提出日時 2021-12-20 02:52:09
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 366 bytes
コンパイル時間 92 ms
コンパイル使用メモリ 10,860 KB
実行使用メモリ 111,336 KB
最終ジャッジ日時 2023-10-13 19:23:24
合計ジャッジ時間 73,712 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 16 ms
7,880 KB
testcase_01 AC 16 ms
7,880 KB
testcase_02 AC 17 ms
7,764 KB
testcase_03 AC 15 ms
7,848 KB
testcase_04 AC 16 ms
7,844 KB
testcase_05 AC 17 ms
7,788 KB
testcase_06 AC 15 ms
7,768 KB
testcase_07 AC 16 ms
7,756 KB
testcase_08 AC 251 ms
17,036 KB
testcase_09 AC 217 ms
15,844 KB
testcase_10 AC 217 ms
15,900 KB
testcase_11 AC 197 ms
15,124 KB
testcase_12 AC 120 ms
12,492 KB
testcase_13 TLE -
testcase_14 TLE -
testcase_15 AC 2,456 ms
78,640 KB
testcase_16 AC 2,360 ms
76,800 KB
testcase_17 TLE -
testcase_18 AC 2,798 ms
88,620 KB
testcase_19 TLE -
testcase_20 AC 2,544 ms
81,972 KB
testcase_21 TLE -
testcase_22 TLE -
testcase_23 AC 2,620 ms
83,700 KB
testcase_24 TLE -
testcase_25 TLE -
testcase_26 TLE -
testcase_27 AC 2,843 ms
88,316 KB
testcase_28 TLE -
testcase_29 TLE -
testcase_30 TLE -
testcase_31 AC 16 ms
7,812 KB
testcase_32 TLE -
testcase_33 TLE -
testcase_34 TLE -
権限があれば一括ダウンロードができます

ソースコード

diff #

from sys import stdin
input=lambda :stdin.readline()[:-1]

def main(n,x):
  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 i in x:
    print(dp[i]*sm[n//i])

n,q=map(int,input().split())
x=[0]*q
for i in range(q):
  x[i]=int(input())
if __name__=="__main__":
  main(n,x)
0