結果

問題 No.2526 Kth Not-divisible Number
ユーザー 👑 p-adicp-adic
提出日時 2023-07-06 21:24:24
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 204 bytes
コンパイル時間 75 ms
コンパイル使用メモリ 11,948 KB
実行使用メモリ 20,264 KB
最終ジャッジ日時 2023-11-03 21:27:24
合計ジャッジ時間 4,041 ms
ジャッジサーバーID
(参考情報)
judge15 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 29 ms
20,264 KB
testcase_01 AC 30 ms
10,136 KB
testcase_02 AC 27 ms
10,136 KB
testcase_03 TLE -
testcase_04 -- -
testcase_05 -- -
testcase_06 -- -
testcase_07 -- -
testcase_08 -- -
testcase_09 -- -
testcase_10 -- -
testcase_11 -- -
権限があれば一括ダウンロードができます

ソースコード

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