結果

問題 No.1383 Numbers of Product
ユーザー MitarushiMitarushi
提出日時 2020-12-15 19:06:18
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 651 bytes
コンパイル時間 501 ms
コンパイル使用メモリ 87,084 KB
実行使用メモリ 167,868 KB
最終ジャッジ日時 2023-09-17 16:09:59
合計ジャッジ時間 18,739 ms
ジャッジサーバーID
(参考情報)
judge14 / judge15
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 79 ms
71,764 KB
testcase_01 AC 74 ms
71,584 KB
testcase_02 AC 75 ms
71,804 KB
testcase_03 AC 73 ms
71,672 KB
testcase_04 AC 75 ms
71,684 KB
testcase_05 AC 75 ms
71,848 KB
testcase_06 AC 76 ms
71,752 KB
testcase_07 AC 358 ms
147,652 KB
testcase_08 AC 353 ms
147,644 KB
testcase_09 AC 432 ms
167,780 KB
testcase_10 AC 560 ms
167,484 KB
testcase_11 AC 578 ms
167,376 KB
testcase_12 AC 573 ms
167,656 KB
testcase_13 AC 534 ms
167,372 KB
testcase_14 AC 455 ms
167,588 KB
testcase_15 AC 365 ms
148,260 KB
testcase_16 AC 569 ms
167,260 KB
testcase_17 AC 78 ms
71,820 KB
testcase_18 AC 75 ms
71,724 KB
testcase_19 AC 78 ms
71,776 KB
testcase_20 AC 78 ms
71,704 KB
testcase_21 AC 79 ms
71,584 KB
testcase_22 WA -
testcase_23 AC 76 ms
71,752 KB
testcase_24 WA -
testcase_25 AC 77 ms
71,700 KB
testcase_26 AC 76 ms
71,880 KB
testcase_27 AC 76 ms
71,532 KB
testcase_28 AC 95 ms
78,168 KB
testcase_29 AC 447 ms
167,440 KB
testcase_30 AC 583 ms
167,868 KB
testcase_31 AC 76 ms
71,740 KB
testcase_32 AC 179 ms
112,704 KB
testcase_33 AC 78 ms
71,716 KB
testcase_34 AC 85 ms
76,820 KB
testcase_35 AC 534 ms
167,296 KB
testcase_36 AC 508 ms
167,512 KB
testcase_37 AC 588 ms
167,484 KB
testcase_38 AC 587 ms
167,496 KB
testcase_39 AC 592 ms
167,544 KB
testcase_40 AC 593 ms
167,468 KB
testcase_41 AC 552 ms
167,380 KB
testcase_42 AC 545 ms
167,464 KB
testcase_43 AC 568 ms
167,288 KB
testcase_44 AC 570 ms
167,672 KB
testcase_45 AC 555 ms
167,468 KB
testcase_46 AC 73 ms
71,604 KB
testcase_47 AC 549 ms
167,688 KB
testcase_48 AC 537 ms
167,492 KB
testcase_49 AC 541 ms
167,616 KB
testcase_50 AC 556 ms
167,400 KB
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

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


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