結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 89 ms
76,088 KB
testcase_01 AC 83 ms
76,540 KB
testcase_02 AC 80 ms
76,112 KB
testcase_03 AC 82 ms
76,172 KB
testcase_04 AC 81 ms
76,316 KB
testcase_05 AC 82 ms
76,328 KB
testcase_06 AC 82 ms
76,112 KB
testcase_07 AC 380 ms
148,192 KB
testcase_08 AC 383 ms
148,228 KB
testcase_09 AC 443 ms
167,560 KB
testcase_10 AC 583 ms
167,560 KB
testcase_11 AC 574 ms
167,556 KB
testcase_12 AC 568 ms
167,436 KB
testcase_13 AC 547 ms
167,548 KB
testcase_14 AC 467 ms
167,604 KB
testcase_15 AC 386 ms
147,380 KB
testcase_16 AC 542 ms
167,564 KB
testcase_17 AC 83 ms
76,132 KB
testcase_18 AC 81 ms
76,128 KB
testcase_19 AC 82 ms
76,056 KB
testcase_20 AC 81 ms
75,948 KB
testcase_21 AC 83 ms
76,120 KB
testcase_22 WA -
testcase_23 AC 82 ms
76,276 KB
testcase_24 WA -
testcase_25 AC 82 ms
76,372 KB
testcase_26 WA -
testcase_27 AC 80 ms
76,088 KB
testcase_28 AC 98 ms
78,084 KB
testcase_29 AC 449 ms
167,492 KB
testcase_30 AC 586 ms
167,376 KB
testcase_31 AC 81 ms
76,100 KB
testcase_32 AC 190 ms
112,152 KB
testcase_33 AC 83 ms
75,924 KB
testcase_34 AC 89 ms
76,824 KB
testcase_35 AC 542 ms
167,496 KB
testcase_36 AC 505 ms
167,428 KB
testcase_37 AC 579 ms
167,488 KB
testcase_38 AC 575 ms
167,404 KB
testcase_39 AC 589 ms
167,272 KB
testcase_40 AC 582 ms
167,484 KB
testcase_41 AC 551 ms
167,432 KB
testcase_42 AC 549 ms
167,496 KB
testcase_43 AC 574 ms
167,632 KB
testcase_44 AC 575 ms
167,560 KB
testcase_45 AC 540 ms
167,760 KB
testcase_46 AC 83 ms
76,176 KB
testcase_47 AC 550 ms
167,700 KB
testcase_48 AC 562 ms
167,624 KB
testcase_49 AC 546 ms
167,624 KB
testcase_50 AC 574 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