結果

問題 No.928 軽減税率?
コンテスト
ユーザー hedwig100
提出日時 2020-04-09 19:48:05
言語 Python3
(3.14.3 + numpy 2.4.4 + scipy 1.17.1)
コンパイル:
python3 -mpy_compile _filename_
実行:
python3 _filename_
結果
WA  
実行時間 -
コード長 723 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 345 ms
コンパイル使用メモリ 20,700 KB
実行使用メモリ 15,360 KB
最終ジャッジ日時 2026-04-04 07:37:16
合計ジャッジ時間 5,226 ms
ジャッジサーバーID
(参考情報)
judge4_0 / judge3_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

MOD = 10 ** 9 + 7
INF = 10 ** 10
import sys
input = sys.stdin.readline
sys.setrecursionlimit(100000000)
dy = (-1,0,1,0)
dx = (0,1,0,-1)
from bisect import bisect_left,bisect_right
from collections import deque

def ok(x,p,q,a):
    return (x + (x * p)//100) < (x + (x * q)//100) + a

def main():
    p,q,a = map(int,input().split())
    if p <= q:
        print(1000000000)
        return
    
    l = -1
    r = 10 ** 9 + 1
    while r - l > 1:
        mid = (r + l)//2
        if ok(mid,p,q,a):
            l = mid
        else:
            r = mid
    
    ans = max(l - 100,0)
    for i in range(max(l - 99,1),l + 100):
        if ok(i,p,q,a):
            ans += 1
    print(ans)

if __name__ =='__main__':
    main()  
0