結果

問題 No.928 軽減税率?
ユーザー chocopuu
提出日時 2019-11-22 22:01:08
言語 C++14
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 987 bytes
コンパイル時間 1,680 ms
コンパイル使用メモリ 166,352 KB
実行使用メモリ 5,248 KB
最終ジャッジ日時 2024-10-11 03:38:33
合計ジャッジ時間 2,693 ms
ジャッジサーバーID
(参考情報)
judge1 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 10
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
#define int long long
#define REP(i,n) for(int i = 0;i < (int)(n);i++)
#define RREP(i,n) for(int i = (int)n-1;i >= 0;i--)
#define FOR(i,s,n) for(int i = s;i < (int)n;i++)
#define RFOR(i,s,n) for(int i = (int)n-1;i >= s;i--)
#define ALL(a) a.begin(),a.end()
#define IN(a, x, b) (a<=x && x<b)
template<class T>inline bool CHMAX(T&a,T b){if(a<b){a = b;return true;}return false;}
template<class T>inline bool CHMIN(T&a,T b){if(a>b){a = b;return true;}return false;}
constexpr long long INF = 1e18;


signed main(){
	int P,Q,A;
	cin>>P>>Q>>A;
	auto f =[&](int x)->bool{
		int mise = (100+P)*x/100;
		int takeout = (100+Q)*x/100+A;
		return mise < takeout;
	};
	int l = 0, r = 1e9 + 1;
	while(r - l > 1){
		int c = (l + r) / 2;
		if(f(c)) l = c;
		else r = c;
	}
	int cand = l - 1000000;
	int ans = max(0ll,cand);
	REP(i,2000000){
		int ni = i + cand + 1;
		if(ni < 1)continue;
		if(ni > 1e9)continue;
		if(f(ni))ans++;
	}
	cout << ans << endl;
}
0