結果

問題 No.928 軽減税率?
ユーザー ptotqptotq
提出日時 2019-11-22 23:03:57
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 506 bytes
コンパイル時間 315 ms
コンパイル使用メモリ 82,300 KB
実行使用メモリ 54,500 KB
最終ジャッジ日時 2024-04-19 12:23:51
合計ジャッジ時間 3,259 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 41 ms
52,740 KB
testcase_01 AC 40 ms
53,536 KB
testcase_02 AC 38 ms
53,192 KB
testcase_03 AC 37 ms
52,812 KB
testcase_04 AC 39 ms
53,372 KB
testcase_05 AC 41 ms
52,532 KB
testcase_06 AC 42 ms
52,276 KB
testcase_07 AC 38 ms
52,772 KB
testcase_08 AC 42 ms
52,404 KB
testcase_09 AC 41 ms
52,060 KB
testcase_10 AC 39 ms
54,036 KB
testcase_11 AC 41 ms
51,872 KB
testcase_12 AC 42 ms
52,524 KB
testcase_13 AC 41 ms
53,624 KB
testcase_14 AC 40 ms
52,532 KB
testcase_15 AC 40 ms
52,276 KB
testcase_16 AC 41 ms
52,476 KB
testcase_17 AC 41 ms
53,508 KB
testcase_18 AC 44 ms
52,636 KB
testcase_19 AC 46 ms
53,492 KB
testcase_20 AC 43 ms
52,472 KB
testcase_21 AC 43 ms
53,072 KB
testcase_22 AC 45 ms
53,128 KB
testcase_23 AC 46 ms
53,088 KB
testcase_24 AC 42 ms
52,276 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 41 ms
53,088 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-10


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