結果

問題 No.2417 Div Count
ユーザー Seed57_cashSeed57_cash
提出日時 2023-06-22 08:57:24
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 90 ms / 2,000 ms
コード長 428 bytes
コンパイル時間 294 ms
コンパイル使用メモリ 87,112 KB
実行使用メモリ 75,916 KB
最終ジャッジ日時 2023-10-11 06:05:31
合計ジャッジ時間 6,374 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 73 ms
71,152 KB
testcase_01 AC 74 ms
71,452 KB
testcase_02 AC 74 ms
71,388 KB
testcase_03 AC 73 ms
71,304 KB
testcase_04 AC 74 ms
71,124 KB
testcase_05 AC 74 ms
71,316 KB
testcase_06 AC 73 ms
70,964 KB
testcase_07 AC 73 ms
71,136 KB
testcase_08 AC 73 ms
71,408 KB
testcase_09 AC 72 ms
71,576 KB
testcase_10 AC 72 ms
71,440 KB
testcase_11 AC 72 ms
71,204 KB
testcase_12 AC 72 ms
71,576 KB
testcase_13 AC 73 ms
71,340 KB
testcase_14 AC 73 ms
71,292 KB
testcase_15 AC 72 ms
70,968 KB
testcase_16 AC 74 ms
71,496 KB
testcase_17 AC 73 ms
71,152 KB
testcase_18 AC 74 ms
70,972 KB
testcase_19 AC 75 ms
71,344 KB
testcase_20 AC 76 ms
75,800 KB
testcase_21 AC 73 ms
71,316 KB
testcase_22 AC 74 ms
71,268 KB
testcase_23 AC 77 ms
75,780 KB
testcase_24 AC 76 ms
75,732 KB
testcase_25 AC 74 ms
75,916 KB
testcase_26 AC 74 ms
75,816 KB
testcase_27 AC 74 ms
75,744 KB
testcase_28 AC 74 ms
75,732 KB
testcase_29 AC 76 ms
75,744 KB
testcase_30 AC 76 ms
75,856 KB
testcase_31 AC 76 ms
75,716 KB
testcase_32 AC 80 ms
75,588 KB
testcase_33 AC 75 ms
75,876 KB
testcase_34 AC 78 ms
75,872 KB
testcase_35 AC 82 ms
75,884 KB
testcase_36 AC 80 ms
75,836 KB
testcase_37 AC 78 ms
75,764 KB
testcase_38 AC 90 ms
75,780 KB
testcase_39 AC 80 ms
75,872 KB
testcase_40 AC 78 ms
75,800 KB
testcase_41 AC 77 ms
75,636 KB
testcase_42 AC 72 ms
71,308 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

# N // A = Q とすると、N = A * Q + K
# なので(N - K)の約数かつKより大きいものを求める

N, K = map(int, input().split())
M = N - K

res = 0
for i in range(1, M + 1):
	if i * i > M:
		# 約数はペアなのでsqrt(M)まで探せばいい
		break
	if M % i == 0:
		if i > K:
			res += 1
		if M // i > K and i * i < M:
			# i * i == M のときに2重カウントしないように
			res += 1
	
print(res)
0