結果

問題 No.2526 Kth Not-divisible Number
ユーザー 👑 p-adicp-adic
提出日時 2023-07-06 21:24:43
言語 PyPy3
(7.3.15)
結果
AC  
実行時間 599 ms / 2,000 ms
コード長 204 bytes
コンパイル時間 4,226 ms
コンパイル使用メモリ 81,648 KB
実行使用メモリ 75,908 KB
最終ジャッジ日時 2023-11-03 21:27:53
合計ジャッジ時間 6,737 ms
ジャッジサーバーID
(参考情報)
judge10 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
53,540 KB
testcase_01 AC 32 ms
53,540 KB
testcase_02 AC 30 ms
53,540 KB
testcase_03 AC 599 ms
75,816 KB
testcase_04 AC 591 ms
75,824 KB
testcase_05 AC 594 ms
75,896 KB
testcase_06 AC 580 ms
75,900 KB
testcase_07 AC 586 ms
75,900 KB
testcase_08 AC 587 ms
75,908 KB
testcase_09 AC 582 ms
75,908 KB
testcase_10 AC 555 ms
75,900 KB
testcase_11 AC 480 ms
75,896 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

I=input
for t in range(int(I())):
	A,B,K=map(int,I().split())
	C,D=A,B
	if A>B:C,D=D,C
	while C:C,D=D%C,C
	C=A*B//D
	L,R=1,2**62
	while L<R:
		M=(L+R)//2
		if M-M//A-M//B+M//C<K:L=M+1
		else:R=M
	print(L)
0