結果

問題 No.1383 Numbers of Product
ユーザー convexineqconvexineq
提出日時 2021-02-09 18:02:40
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 649 bytes
コンパイル時間 508 ms
コンパイル使用メモリ 87,028 KB
実行使用メモリ 260,752 KB
最終ジャッジ日時 2023-09-21 05:34:45
合計ジャッジ時間 17,512 ms
ジャッジサーバーID
(参考情報)
judge12 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 107 ms
77,340 KB
testcase_01 AC 110 ms
77,104 KB
testcase_02 AC 107 ms
76,920 KB
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 AC 110 ms
77,244 KB
testcase_07 WA -
testcase_08 WA -
testcase_09 AC 317 ms
198,920 KB
testcase_10 WA -
testcase_11 WA -
testcase_12 WA -
testcase_13 WA -
testcase_14 WA -
testcase_15 WA -
testcase_16 WA -
testcase_17 AC 108 ms
77,176 KB
testcase_18 AC 104 ms
77,140 KB
testcase_19 AC 105 ms
77,156 KB
testcase_20 AC 106 ms
76,988 KB
testcase_21 AC 104 ms
76,988 KB
testcase_22 WA -
testcase_23 AC 104 ms
76,932 KB
testcase_24 WA -
testcase_25 AC 103 ms
77,176 KB
testcase_26 WA -
testcase_27 WA -
testcase_28 AC 118 ms
78,464 KB
testcase_29 WA -
testcase_30 WA -
testcase_31 AC 107 ms
77,072 KB
testcase_32 AC 172 ms
112,512 KB
testcase_33 WA -
testcase_34 AC 112 ms
77,004 KB
testcase_35 AC 374 ms
227,460 KB
testcase_36 WA -
testcase_37 WA -
testcase_38 WA -
testcase_39 WA -
testcase_40 AC 412 ms
244,240 KB
testcase_41 WA -
testcase_42 WA -
testcase_43 WA -
testcase_44 WA -
testcase_45 WA -
testcase_46 AC 107 ms
76,760 KB
testcase_47 WA -
testcase_48 WA -
testcase_49 WA -
testcase_50 WA -
testcase_51 WA -
testcase_52 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import sqrt
n,k,m = map(int,input().split())

def is_small(a):
    if float(a)*(a+k)*(a+2*k) > 2e18: return False
    else: return a*(a+k)*(a+2*k) <= n

from collections import Counter
d = Counter()
for a in range(1,10**6+1):
    if is_small(a): d[a*(a+k)*(a+2*k)] += 1

def check(x): # a(a+k) = x なる a ある?
    v = int((sqrt(float(k)**2 + 4.0*x) - k)/2)
    for a in range(max(1,v-3),v+5):
        if a >= 1 and a*(a+k)==x: return True
        if a*(a+k) > x: return False
    return False

ans = 0
for k,v in d.items():
    if v == m and not check(k):
        ans += 1
    elif v == m-1 and check(k):
        ans += 1
print(ans)
0