結果

問題 No.928 軽減税率?
ユーザー ptotqptotq
提出日時 2019-11-22 22:35:18
言語 Python3
(3.12.2 + numpy 1.26.4 + scipy 1.12.0)
結果
TLE  
実行時間 -
コード長 476 bytes
コンパイル時間 99 ms
コンパイル使用メモリ 12,544 KB
実行使用メモリ 17,952 KB
最終ジャッジ日時 2024-04-19 12:03:46
合計ジャッジ時間 3,738 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
17,952 KB
testcase_01 AC 32 ms
10,752 KB
testcase_02 AC 32 ms
10,624 KB
testcase_03 AC 31 ms
10,624 KB
testcase_04 AC 33 ms
10,624 KB
testcase_05 AC 31 ms
10,624 KB
testcase_06 AC 27 ms
10,752 KB
testcase_07 AC 32 ms
10,624 KB
testcase_08 AC 32 ms
10,752 KB
testcase_09 AC 33 ms
10,752 KB
testcase_10 AC 32 ms
10,624 KB
testcase_11 AC 32 ms
10,752 KB
testcase_12 AC 32 ms
10,624 KB
testcase_13 AC 30 ms
10,752 KB
testcase_14 AC 31 ms
10,624 KB
testcase_15 AC 33 ms
10,752 KB
testcase_16 AC 32 ms
10,496 KB
testcase_17 AC 32 ms
10,624 KB
testcase_18 AC 32 ms
10,752 KB
testcase_19 AC 32 ms
10,624 KB
testcase_20 AC 31 ms
10,496 KB
testcase_21 AC 32 ms
10,624 KB
testcase_22 AC 33 ms
10,752 KB
testcase_23 TLE -
testcase_24 -- -
testcase_25 -- -
testcase_26 -- -
testcase_27 -- -
testcase_28 -- -
testcase_29 -- -
testcase_30 -- -
testcase_31 -- -
testcase_32 -- -
testcase_33 -- -
testcase_34 -- -
testcase_35 -- -
権限があれば一括ダウンロードができます

ソースコード

diff #

P, Q, A = map(int, input().split())


def solve(x):
    return (100+P)*x // 100 < (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()

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 = ((100+P)*x // 100) - ((100+Q)*x // 100)
    if d < A:
        ok += 1
    if d >= A+1:
        break

print(ok)
0