結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
76,380 KB
testcase_01 AC 80 ms
76,232 KB
testcase_02 AC 77 ms
76,528 KB
testcase_03 AC 78 ms
76,272 KB
testcase_04 AC 79 ms
76,180 KB
testcase_05 AC 78 ms
76,100 KB
testcase_06 AC 77 ms
76,220 KB
testcase_07 AC 342 ms
147,700 KB
testcase_08 AC 348 ms
148,172 KB
testcase_09 AC 396 ms
167,812 KB
testcase_10 AC 509 ms
167,672 KB
testcase_11 AC 495 ms
167,724 KB
testcase_12 AC 502 ms
167,548 KB
testcase_13 AC 491 ms
167,600 KB
testcase_14 AC 413 ms
167,472 KB
testcase_15 AC 340 ms
147,472 KB
testcase_16 AC 509 ms
167,712 KB
testcase_17 AC 79 ms
76,396 KB
testcase_18 AC 79 ms
76,432 KB
testcase_19 AC 80 ms
76,160 KB
testcase_20 AC 79 ms
76,360 KB
testcase_21 AC 80 ms
76,460 KB
testcase_22 WA -
testcase_23 AC 81 ms
76,432 KB
testcase_24 WA -
testcase_25 AC 79 ms
76,364 KB
testcase_26 WA -
testcase_27 AC 78 ms
76,072 KB
testcase_28 AC 95 ms
78,400 KB
testcase_29 AC 406 ms
167,728 KB
testcase_30 AC 524 ms
167,592 KB
testcase_31 AC 76 ms
76,376 KB
testcase_32 AC 170 ms
112,280 KB
testcase_33 AC 77 ms
76,116 KB
testcase_34 AC 80 ms
77,028 KB
testcase_35 AC 469 ms
167,588 KB
testcase_36 AC 434 ms
167,536 KB
testcase_37 AC 526 ms
167,524 KB
testcase_38 AC 518 ms
167,592 KB
testcase_39 AC 521 ms
167,544 KB
testcase_40 AC 536 ms
167,424 KB
testcase_41 AC 517 ms
167,576 KB
testcase_42 AC 535 ms
167,576 KB
testcase_43 AC 559 ms
167,732 KB
testcase_44 AC 554 ms
167,796 KB
testcase_45 AC 517 ms
167,776 KB
testcase_46 AC 79 ms
76,468 KB
testcase_47 AC 486 ms
167,484 KB
testcase_48 AC 493 ms
167,484 KB
testcase_49 AC 493 ms
167,792 KB
testcase_50 AC 522 ms
167,568 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, 100):
    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