結果

問題 No.1383 Numbers of Product
ユーザー MitarushiMitarushi
提出日時 2020-12-15 19:32:01
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 474 ms / 2,000 ms
コード長 758 bytes
コンパイル時間 533 ms
コンパイル使用メモリ 87,156 KB
実行使用メモリ 167,872 KB
最終ジャッジ日時 2023-08-14 22:07:21
合計ジャッジ時間 15,720 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 68 ms
71,852 KB
testcase_01 AC 71 ms
71,344 KB
testcase_02 AC 66 ms
71,280 KB
testcase_03 AC 64 ms
71,596 KB
testcase_04 AC 66 ms
71,764 KB
testcase_05 AC 68 ms
71,844 KB
testcase_06 AC 68 ms
71,668 KB
testcase_07 AC 298 ms
148,344 KB
testcase_08 AC 304 ms
148,348 KB
testcase_09 AC 353 ms
167,644 KB
testcase_10 AC 457 ms
167,480 KB
testcase_11 AC 451 ms
167,596 KB
testcase_12 AC 448 ms
167,356 KB
testcase_13 AC 433 ms
167,740 KB
testcase_14 AC 370 ms
167,692 KB
testcase_15 AC 309 ms
147,696 KB
testcase_16 AC 443 ms
167,372 KB
testcase_17 AC 67 ms
71,452 KB
testcase_18 AC 67 ms
71,272 KB
testcase_19 AC 68 ms
71,312 KB
testcase_20 AC 67 ms
71,308 KB
testcase_21 AC 68 ms
71,268 KB
testcase_22 AC 66 ms
71,376 KB
testcase_23 AC 66 ms
71,468 KB
testcase_24 AC 69 ms
71,288 KB
testcase_25 AC 69 ms
71,204 KB
testcase_26 AC 68 ms
71,504 KB
testcase_27 AC 69 ms
71,520 KB
testcase_28 AC 82 ms
78,164 KB
testcase_29 AC 387 ms
167,476 KB
testcase_30 AC 470 ms
167,720 KB
testcase_31 AC 66 ms
71,400 KB
testcase_32 AC 153 ms
112,680 KB
testcase_33 AC 65 ms
71,432 KB
testcase_34 AC 72 ms
76,876 KB
testcase_35 AC 423 ms
167,356 KB
testcase_36 AC 402 ms
167,560 KB
testcase_37 AC 455 ms
167,476 KB
testcase_38 AC 452 ms
167,648 KB
testcase_39 AC 455 ms
167,676 KB
testcase_40 AC 455 ms
167,796 KB
testcase_41 AC 443 ms
167,676 KB
testcase_42 AC 435 ms
167,416 KB
testcase_43 AC 474 ms
167,388 KB
testcase_44 AC 461 ms
167,644 KB
testcase_45 AC 471 ms
167,624 KB
testcase_46 AC 65 ms
71,288 KB
testcase_47 AC 429 ms
167,572 KB
testcase_48 AC 457 ms
167,460 KB
testcase_49 AC 467 ms
167,872 KB
testcase_50 AC 460 ms
167,484 KB
testcase_51 AC 69 ms
71,152 KB
testcase_52 AC 66 ms
71,060 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

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


def max2(x):
    ok = 0
    ng = 10**9
    while ng - ok > 1:
        m = (ok + ng) // 2
        if m * (m + k) <= x:
            ok = m
        else:
            ng = m
    return ok


def is_2(x):
    y = round(-k/2 + ((k/2)**2 + x)**0.5)
    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