結果

問題 No.928 軽減税率?
ユーザー 双六双六
提出日時 2020-08-20 21:01:56
言語 PyPy3
(7.3.15)
結果
WA  
実行時間 -
コード長 844 bytes
コンパイル時間 276 ms
コンパイル使用メモリ 82,460 KB
実行使用メモリ 66,076 KB
最終ジャッジ日時 2024-04-21 19:16:38
合計ジャッジ時間 3,476 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 52 ms
60,160 KB
testcase_01 AC 57 ms
61,696 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 57 ms
62,080 KB
testcase_05 AC 56 ms
62,080 KB
testcase_06 AC 57 ms
61,824 KB
testcase_07 AC 55 ms
62,208 KB
testcase_08 AC 56 ms
62,080 KB
testcase_09 WA -
testcase_10 AC 55 ms
62,336 KB
testcase_11 AC 56 ms
61,952 KB
testcase_12 WA -
testcase_13 AC 55 ms
61,696 KB
testcase_14 AC 56 ms
62,080 KB
testcase_15 AC 57 ms
61,952 KB
testcase_16 AC 55 ms
62,080 KB
testcase_17 WA -
testcase_18 WA -
testcase_19 WA -
testcase_20 WA -
testcase_21 WA -
testcase_22 RE -
testcase_23 WA -
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 RE -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

import sys; input = sys.stdin.buffer.readline
sys.setrecursionlimit(10**7)
from collections import defaultdict
con = 10 ** 9 + 7; INF = float("inf")

def getlist():
	return list(map(int, input().split()))

def func(P, Q, A, x):
	val = int((100 * x + P * x) // 100) - int((100 * x + Q * x) // 100) - A 
	return val

def Binary_Search(P, Q, A):
	#初期化
	left = 1
	right = 10 ** 9
	ans = None
	
	#二分探索
	while left <= right:
		x = (left + right) // 2
		if func(P, Q, A, x) >= 0:
			right = x - 1
		else:
			ans = x
			left = x + 1

	return ans

#処理内容
def main():
	P, Q, A = getlist()
	ans = Binary_Search(P, Q, A)
	for i in range(max(1, ans - 1000000), ans):
		if func(P, Q, A, i) >= 0:
			ans -= 2

	for i in range(ans + 1, ans + 1000000):
		if func(P, Q, A, i) < 0:
			ans += 1

	print(ans)

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