結果

問題 No.1791 Repeat Multiplication
ユーザー gr1msl3ygr1msl3y
提出日時 2021-12-24 08:15:24
言語 PyPy3
(7.3.13)
結果
AC  
実行時間 815 ms / 3,000 ms
コード長 276 bytes
コンパイル時間 169 ms
コンパイル使用メモリ 81,756 KB
実行使用メモリ 99,548 KB
最終ジャッジ日時 2023-10-19 08:56:50
合計ジャッジ時間 19,332 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 42 ms
53,500 KB
testcase_01 AC 39 ms
53,500 KB
testcase_02 AC 59 ms
64,328 KB
testcase_03 AC 42 ms
53,500 KB
testcase_04 AC 50 ms
61,532 KB
testcase_05 AC 53 ms
61,532 KB
testcase_06 AC 41 ms
53,500 KB
testcase_07 AC 50 ms
61,532 KB
testcase_08 AC 311 ms
77,868 KB
testcase_09 AC 285 ms
77,772 KB
testcase_10 AC 285 ms
77,512 KB
testcase_11 AC 267 ms
77,400 KB
testcase_12 AC 197 ms
76,912 KB
testcase_13 AC 669 ms
97,924 KB
testcase_14 AC 652 ms
98,496 KB
testcase_15 AC 506 ms
92,264 KB
testcase_16 AC 514 ms
91,912 KB
testcase_17 AC 660 ms
98,944 KB
testcase_18 AC 559 ms
94,504 KB
testcase_19 AC 684 ms
97,764 KB
testcase_20 AC 550 ms
93,016 KB
testcase_21 AC 639 ms
97,524 KB
testcase_22 AC 710 ms
99,056 KB
testcase_23 AC 543 ms
93,392 KB
testcase_24 AC 668 ms
98,116 KB
testcase_25 AC 605 ms
96,884 KB
testcase_26 AC 635 ms
98,548 KB
testcase_27 AC 566 ms
94,464 KB
testcase_28 AC 724 ms
99,540 KB
testcase_29 AC 724 ms
99,528 KB
testcase_30 AC 738 ms
99,544 KB
testcase_31 AC 39 ms
53,500 KB
testcase_32 AC 815 ms
99,548 KB
testcase_33 AC 732 ms
99,548 KB
testcase_34 AC 708 ms
99,544 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

N,Q=map(int,input().split())
bu=[0]*(N+1)
bu[1]=1
td=[1]*(N+1)
for i in range(1,N+1):
    for j in range(2*i,N+1,i):
        bu[j]+=bu[i]
for i in range(N,0,-1):
    for j in range(2*i,N+1,i):
        td[i]+=td[j]

for _ in range(Q):
    q=int(input())
    print(td[q]*bu[q])
0