結果

問題 No.928 軽減税率?
ユーザー kazumakazuma
提出日時 2019-11-22 21:36:02
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 606 bytes
コンパイル時間 2,353 ms
コンパイル使用メモリ 194,124 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 10:39:35
合計ジャッジ時間 2,692 ms
ジャッジサーバーID
(参考情報)
judge2 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 4 ms
5,248 KB
testcase_01 AC 3 ms
5,376 KB
testcase_02 AC 4 ms
5,376 KB
testcase_03 AC 3 ms
5,376 KB
testcase_04 AC 4 ms
5,376 KB
testcase_05 AC 4 ms
5,376 KB
testcase_06 AC 4 ms
5,376 KB
testcase_07 AC 3 ms
5,376 KB
testcase_08 AC 4 ms
5,376 KB
testcase_09 AC 4 ms
5,376 KB
testcase_10 AC 4 ms
5,376 KB
testcase_11 AC 3 ms
5,376 KB
testcase_12 AC 4 ms
5,376 KB
testcase_13 AC 4 ms
5,376 KB
testcase_14 AC 3 ms
5,376 KB
testcase_15 AC 4 ms
5,376 KB
testcase_16 AC 4 ms
5,376 KB
testcase_17 AC 6 ms
5,376 KB
testcase_18 AC 6 ms
5,376 KB
testcase_19 AC 6 ms
5,376 KB
testcase_20 AC 6 ms
5,376 KB
testcase_21 AC 6 ms
5,376 KB
testcase_22 AC 4 ms
5,376 KB
testcase_23 AC 3 ms
5,376 KB
testcase_24 AC 4 ms
5,376 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 4 ms
5,376 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
using ll = long long;

ll range = 1000000;

int main()
{
	ios::sync_with_stdio(false), cin.tie(0);
	int P, Q, A;
	cin >> P >> Q >> A;
	const ll MAX = 1e9 + 1;
	ll lb = 0, ub = MAX;
	while (ub - lb > 1) {
		ll m = (lb + ub) / 2;
		if ((100 + Q) * m / 100 + A <= (100 + P) * m / 100) {
			ub = m;
		}
		else {
			lb = m;
		}
	}
	int res = lb;
	for (ll i = max(1LL, lb - range); i < min(lb + range + 1, MAX); i++) {
		if ((100 + Q) * i / 100 + A > (100 + P) * i / 100) {
			res += i > lb;
		}
		else {
			res -= i <= lb;
		}
	}
	cout << res << endl;
	return 0;
}
0