結果
| 問題 | No.928 軽減税率? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-22 21:44:14 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 681 bytes |
| 記録 | |
| コンパイル時間 | 1,648 ms |
| コンパイル使用メモリ | 166,740 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 03:11:33 |
| 合計ジャッジ時間 | 22,796 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 WA * 12 |
ソースコード
#include"bits/stdc++.h"
using namespace std;
#define REP(k,m,n) for(int (k)=(m);(k)<(n);(k)++)
#define rep(i,n) REP((i),0,(n))
using ll=long long;
using ld=long double;
bool judge(ld P,ld Q,ll A, ll x){
ll in = floor((1+P/100)*x);
ll out = floor((1+Q/100)*x)+A;
//cout<<x<<":"<<in<<"-"<<out<<endl;
return in<out;
}
ll rjudge(ld P, ld Q, ll A){
ll safe=0,out=1'000'000'001;
while(out-safe>1){
ll mid=(safe+out)/2;
(judge(P,Q,A,mid)?safe:out)=mid;
}
return safe;
}
int main()
{
ld P,Q;
ll A;
cin>>P>>Q>>A;
ll res = rjudge(P,Q,A);
if(res>5e7){
cout<<res<<endl;
}else{
res=0;
REP(x,1,5e7){
if(judge(P,Q,A,x))res++;
}
cout<<res<<endl;
}
return 0;
}