結果

問題 No.928 軽減税率?
ユーザー ptotqptotq
提出日時 2019-11-22 22:49:33
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 507 bytes
コンパイル時間 258 ms
コンパイル使用メモリ 82,464 KB
実行使用メモリ 54,104 KB
最終ジャッジ日時 2024-04-19 12:10:27
合計ジャッジ時間 2,617 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 38 ms
53,160 KB
testcase_01 AC 35 ms
53,348 KB
testcase_02 AC 33 ms
51,940 KB
testcase_03 AC 34 ms
52,552 KB
testcase_04 AC 33 ms
52,676 KB
testcase_05 AC 35 ms
52,212 KB
testcase_06 AC 36 ms
52,612 KB
testcase_07 AC 36 ms
52,600 KB
testcase_08 AC 35 ms
52,488 KB
testcase_09 AC 37 ms
52,272 KB
testcase_10 AC 32 ms
53,632 KB
testcase_11 AC 32 ms
53,048 KB
testcase_12 AC 31 ms
53,368 KB
testcase_13 AC 32 ms
51,944 KB
testcase_14 AC 35 ms
52,828 KB
testcase_15 AC 35 ms
53,352 KB
testcase_16 AC 37 ms
53,616 KB
testcase_17 AC 36 ms
52,896 KB
testcase_18 AC 33 ms
51,880 KB
testcase_19 AC 35 ms
52,620 KB
testcase_20 AC 32 ms
52,624 KB
testcase_21 AC 35 ms
53,352 KB
testcase_22 AC 35 ms
52,652 KB
testcase_23 AC 34 ms
53,416 KB
testcase_24 AC 31 ms
52,772 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
52,180 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-1


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+1:
        break

print(ok)
0