結果

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

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 247 ms
5,248 KB
testcase_01 AC 247 ms
5,376 KB
testcase_02 AC 246 ms
5,376 KB
testcase_03 AC 246 ms
5,376 KB
testcase_04 AC 248 ms
5,376 KB
testcase_05 AC 247 ms
5,376 KB
testcase_06 AC 247 ms
5,376 KB
testcase_07 AC 246 ms
5,376 KB
testcase_08 AC 248 ms
5,376 KB
testcase_09 AC 245 ms
5,376 KB
testcase_10 AC 249 ms
5,376 KB
testcase_11 AC 245 ms
5,376 KB
testcase_12 AC 247 ms
5,376 KB
testcase_13 AC 247 ms
5,376 KB
testcase_14 AC 247 ms
5,376 KB
testcase_15 AC 249 ms
5,376 KB
testcase_16 AC 248 ms
5,376 KB
testcase_17 AC 248 ms
5,376 KB
testcase_18 AC 251 ms
5,376 KB
testcase_19 AC 250 ms
5,376 KB
testcase_20 AC 249 ms
5,376 KB
testcase_21 AC 249 ms
5,376 KB
testcase_22 AC 247 ms
5,376 KB
testcase_23 AC 246 ms
5,376 KB
testcase_24 AC 246 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 248 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 = 100000000;

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