結果

問題 No.928 軽減税率?
ユーザー ptotqptotq
提出日時 2019-11-22 22:56:22
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 513 bytes
コンパイル時間 218 ms
コンパイル使用メモリ 82,768 KB
実行使用メモリ 60,732 KB
最終ジャッジ日時 2024-04-19 12:17:51
合計ジャッジ時間 2,490 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 36 ms
59,780 KB
testcase_01 AC 40 ms
60,068 KB
testcase_02 AC 35 ms
52,128 KB
testcase_03 AC 34 ms
53,380 KB
testcase_04 AC 38 ms
59,912 KB
testcase_05 AC 37 ms
58,976 KB
testcase_06 AC 38 ms
58,972 KB
testcase_07 AC 36 ms
58,872 KB
testcase_08 AC 37 ms
60,268 KB
testcase_09 AC 37 ms
59,156 KB
testcase_10 AC 41 ms
59,420 KB
testcase_11 AC 37 ms
58,820 KB
testcase_12 AC 39 ms
60,732 KB
testcase_13 AC 39 ms
59,808 KB
testcase_14 AC 39 ms
58,920 KB
testcase_15 AC 40 ms
59,316 KB
testcase_16 AC 38 ms
59,748 KB
testcase_17 AC 38 ms
59,300 KB
testcase_18 AC 39 ms
58,628 KB
testcase_19 AC 39 ms
60,048 KB
testcase_20 AC 39 ms
60,584 KB
testcase_21 AC 38 ms
58,940 KB
testcase_22 AC 33 ms
52,736 KB
testcase_23 AC 32 ms
53,024 KB
testcase_24 AC 33 ms
52,396 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 32 ms
53,124 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

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