結果
| 問題 | 
                            No.928 軽減税率?
                             | 
                    
| コンテスト | |
| ユーザー | 
                             Bwambocos
                         | 
                    
| 提出日時 | 2019-11-22 22:25:08 | 
| 言語 | C++17  (gcc 13.3.0 + boost 1.87.0)  | 
                    
| 結果 | 
                             
                                WA
                                 
                             
                            
                         | 
                    
| 実行時間 | - | 
| コード長 | 800 bytes | 
| コンパイル時間 | 2,091 ms | 
| コンパイル使用メモリ | 192,880 KB | 
| 最終ジャッジ日時 | 2025-01-08 05:13:41 | 
| 
                            ジャッジサーバーID (参考情報)  | 
                        judge1 / judge3 | 
(要ログイン)
| ファイルパターン | 結果 | 
|---|---|
| sample | AC * 2 | 
| other | AC * 18 WA * 16 | 
ソースコード
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
long double P, Q, A;
bool check(LL x)
{
	LL res1 = (1 + P / 100) * x;
	LL res2 = (1 + Q / 100) * x + A;
	return res1 < res2;
}
int main()
{
	in >> P >> Q >> A;
	LL left = 0, right = 1000000001;
	while (right - left > 1)
	{
		auto mid = (left + right) / 2;
		if (check(mid)) left = mid;
		else right = mid;
	}
	LL ans = left;
	for (LL x = left; x >= left - 1000000; --x)
	{
		if (x <= 0) break;
		LL res1 = (1 + P / 100) * x;
		LL res2 = (1 + Q / 100) * x + A;
		if (res1 >= res2) --ans;
	}
	for (LL x = left + 1; x <= left + 1000000; ++x)
	{
		LL res1 = (1 + P / 100) * x;
		LL res2 = (1 + Q / 100) * x + A;
		if (res1 < res2) ++ans;
	}
	out << ans << std::endl;
}
            
            
            
        
            
Bwambocos