結果
問題 | No.2526 Kth Not-divisible Number |
ユーザー | komkompi |
提出日時 | 2023-11-03 22:03:46 |
言語 | PyPy3 (7.3.15) |
結果 |
AC
|
実行時間 | 993 ms / 2,000 ms |
コード長 | 509 bytes |
コンパイル時間 | 137 ms |
コンパイル使用メモリ | 81,820 KB |
実行使用メモリ | 76,104 KB |
最終ジャッジ日時 | 2023-11-03 22:03:57 |
合計ジャッジ時間 | 9,265 ms |
ジャッジサーバーID (参考情報) |
judge13 / judge12 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 34 ms
53,752 KB |
testcase_01 | AC | 30 ms
53,752 KB |
testcase_02 | AC | 29 ms
53,752 KB |
testcase_03 | AC | 950 ms
76,100 KB |
testcase_04 | AC | 983 ms
76,104 KB |
testcase_05 | AC | 993 ms
76,104 KB |
testcase_06 | AC | 966 ms
76,100 KB |
testcase_07 | AC | 974 ms
76,104 KB |
testcase_08 | AC | 725 ms
76,104 KB |
testcase_09 | AC | 683 ms
76,100 KB |
testcase_10 | AC | 755 ms
76,104 KB |
testcase_11 | AC | 685 ms
76,100 KB |
ソースコード
# coding: utf-8 # Your code here! import math T=int(input()) for _ in range(T): A,B,K=map(int,input().split()) high=3*10**18 low=-1 while high-low>1: middle=(high+low)//2 AB=A*B//math.gcd(A,B) yaku_A=middle//A yaku_B=middle//B yaku_AB=middle//(AB) all_unyaku=middle-yaku_A-yaku_B+yaku_AB if all_unyaku>=K: high=middle else: low=middle print(high)