結果

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

ソースコード

diff #

#include <iostream>
#include <vector>
#include <algorithm>
#include <queue>
#include <map>
#include <set>
#include <math.h>
using namespace std;
typedef long long int ll;

int main(){
	cin.tie(nullptr);
	ios::sync_with_stdio(false);
	ll p,q,a; cin >> p >> q >> a;
	ll left=0,right=1e9+1;
	while(right-left>1){
		ll mid=(left+right)/2;
		if((100+p)*mid/100<(100+q)*mid/100+a){
			left=mid;
		}
		else{
			right=mid;
		}
	}
	ll ans=left-min(left,100LL);
	for(ll i=left-min(left,100LL)+1;i<left-min(left,100LL)+100000;i++){
		if(i>1e9)break;
		if((100+p)*i/100<(100+q)*i/100+a){
			ans++;
		}
	}
	cout << ans << endl;
}
0