結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 33 ms
52,996 KB
testcase_01 AC 32 ms
53,340 KB
testcase_02 AC 33 ms
52,620 KB
testcase_03 AC 31 ms
52,552 KB
testcase_04 AC 31 ms
52,432 KB
testcase_05 AC 32 ms
52,872 KB
testcase_06 AC 33 ms
52,740 KB
testcase_07 AC 35 ms
53,216 KB
testcase_08 AC 32 ms
52,592 KB
testcase_09 AC 32 ms
53,636 KB
testcase_10 AC 31 ms
52,992 KB
testcase_11 AC 31 ms
52,824 KB
testcase_12 AC 31 ms
53,216 KB
testcase_13 AC 30 ms
53,480 KB
testcase_14 AC 30 ms
52,600 KB
testcase_15 AC 32 ms
52,708 KB
testcase_16 AC 32 ms
52,532 KB
testcase_17 AC 30 ms
53,188 KB
testcase_18 AC 31 ms
52,408 KB
testcase_19 AC 32 ms
53,840 KB
testcase_20 AC 31 ms
52,396 KB
testcase_21 AC 32 ms
53,876 KB
testcase_22 AC 34 ms
53,408 KB
testcase_23 AC 35 ms
53,624 KB
testcase_24 AC 33 ms
52,700 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,288 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-5


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

print(ok)
0