結果

問題 No.928 軽減税率?
ユーザー ptotq
提出日時 2019-11-22 22:56:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 513 bytes
コンパイル時間 226 ms
コンパイル使用メモリ 82,432 KB
実行使用メモリ 60,608 KB
最終ジャッジ日時 2024-10-11 04:33:28
合計ジャッジ時間 2,785 ms
ジャッジサーバーID
(参考情報)
judge3 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

P, Q, A = map(int, input().split())
P += 100
Q += 100


def solve(x):
    return P*x // 100 - Q*x // 100 < A-1000


if P < Q:
    print(10**9)
    exit()
if A == 0:
    print(0 if P >= Q else 10**9)
    exit()
if P == Q:
    print(10**9)
    exit()

ok, ng = 0, 10**9+1
while ng - ok > 1:
    mid = (ok+ng)//2
    if solve(mid):
        ok = mid
    else:
        ng = mid

for x in range(ok+1, 10**9+1):
    d = P*x // 100 - Q*x // 100
    if d < A:
        ok += 1
    elif d >= A+1000:
        break

print(ok)
0