結果

問題 No.1350 2019-6problem
ユーザー O2MT
提出日時 2021-02-16 18:42:03
言語 Python3
(3.13.1 + numpy 2.2.1 + scipy 1.14.1)
結果
MLE  
実行時間 -
コード長 388 bytes
コンパイル時間 163 ms
コンパイル使用メモリ 12,672 KB
実行使用メモリ 610,268 KB
最終ジャッジ日時 2024-09-13 07:15:30
合計ジャッジ時間 3,791 ms
ジャッジサーバーID
(参考情報)
judge2 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other MLE * 1 -- * 20
権限があれば一括ダウンロードができます

ソースコード

diff #

from math import gcd
A,B,K = map(int,input().split())
g = (A*B)//gcd(A,B)
a,b = g//A,g//B
k = K//(a+b+1)
# print(g,a,b,k)
# print((a+b)*k,K+1)
la,lb = [],[]
now_a,now_b = g*k,g*k
i = (a+b)*k
while i <= K+g:
    la.append(now_a)
    lb.append(now_b)
    i += 1
    now_a += A
    now_b += B
ans_list = list(set(la+lb))
ans_list.sort()
# print(ans_list)
ans = ans_list[K-(a+b)*k]
print(ans)
0