結果

問題 No.1383 Numbers of Product
ユーザー MitarushiMitarushi
提出日時 2020-12-15 18:54:22
言語 PyPy3
(7.3.15)
結果
WA  
(最新)
AC  
(最初)
実行時間 -
コード長 653 bytes
コンパイル時間 376 ms
コンパイル使用メモリ 87,144 KB
実行使用メモリ 167,676 KB
最終ジャッジ日時 2023-09-17 16:09:25
合計ジャッジ時間 18,670 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 81 ms
71,676 KB
testcase_01 AC 77 ms
71,396 KB
testcase_02 AC 77 ms
71,544 KB
testcase_03 AC 75 ms
71,576 KB
testcase_04 AC 76 ms
71,628 KB
testcase_05 AC 75 ms
71,640 KB
testcase_06 AC 76 ms
71,596 KB
testcase_07 AC 360 ms
146,876 KB
testcase_08 AC 356 ms
147,344 KB
testcase_09 AC 442 ms
166,760 KB
testcase_10 AC 583 ms
167,268 KB
testcase_11 AC 559 ms
167,316 KB
testcase_12 AC 565 ms
167,368 KB
testcase_13 AC 519 ms
167,392 KB
testcase_14 AC 444 ms
167,620 KB
testcase_15 AC 371 ms
147,888 KB
testcase_16 AC 527 ms
167,520 KB
testcase_17 AC 72 ms
71,676 KB
testcase_18 AC 72 ms
71,432 KB
testcase_19 AC 71 ms
71,708 KB
testcase_20 AC 74 ms
71,404 KB
testcase_21 AC 73 ms
71,588 KB
testcase_22 WA -
testcase_23 AC 72 ms
71,700 KB
testcase_24 WA -
testcase_25 AC 74 ms
71,692 KB
testcase_26 WA -
testcase_27 AC 75 ms
71,584 KB
testcase_28 AC 95 ms
78,112 KB
testcase_29 AC 436 ms
167,232 KB
testcase_30 AC 560 ms
167,100 KB
testcase_31 AC 73 ms
71,840 KB
testcase_32 AC 172 ms
112,468 KB
testcase_33 AC 72 ms
71,548 KB
testcase_34 AC 82 ms
76,368 KB
testcase_35 AC 517 ms
167,240 KB
testcase_36 AC 492 ms
167,492 KB
testcase_37 AC 579 ms
167,456 KB
testcase_38 AC 577 ms
167,336 KB
testcase_39 AC 555 ms
167,388 KB
testcase_40 AC 605 ms
167,624 KB
testcase_41 AC 546 ms
167,332 KB
testcase_42 AC 579 ms
167,512 KB
testcase_43 AC 597 ms
167,336 KB
testcase_44 AC 593 ms
167,656 KB
testcase_45 AC 576 ms
167,676 KB
testcase_46 AC 74 ms
71,616 KB
testcase_47 AC 543 ms
167,676 KB
testcase_48 AC 567 ms
167,252 KB
testcase_49 AC 570 ms
167,164 KB
testcase_50 AC 581 ms
167,220 KB
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

n, k, m = map(int, input().split())


def max2(x):
    y = round((-k + (k**2 + 4*x)**0.5) / 2)
    if y*(y+k) > x:
        y -= 1
    return y


def is_2(x):
    y = max2(x)
    return y*(y+k) == x


big2 = {}
for b in range(3, 20):
    i = 1
    while True:
        x = 1
        for j in range(b):
            x *= i + j * k
        if x > n:
            break
        if x in big2:
            big2[x] += 1
        else:
            big2[x] = 1
        i += 1

count_2 = max2(n)
for i in big2:
    if is_2(i):
        big2[i] += 1
        count_2 -= 1

ans = count_2 if m == 1 else 0
for i in big2.values():
    if i == m:
        ans += 1
print(ans)
0