結果
問題 | No.928 軽減税率? |
ユーザー |
|
提出日時 | 2019-11-22 22:20:11 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 680 ms / 1,000 ms |
コード長 | 669 bytes |
コンパイル時間 | 1,465 ms |
コンパイル使用メモリ | 166,588 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 04:01:56 |
合計ジャッジ時間 | 27,556 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include"bits/stdc++.h"using namespace std;#define REP(k,m,n) for(ll (k)=(m);(k)<(n);(k)++)#define rep(i,n) REP((i),0,(n))using ll=long long;using ld=ll;bool judge(ld P,ld Q,ll A, ll x){ll in = (100+P)*x/100;ll out = (100+Q)*x/100+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=0;constexpr ll lim = 100'000'000;REP(x,1,3*lim+1){if(judge(P,Q,A,x))res++;}if(judge(P,Q,A,lim*3)){res+=7*lim;}cout<<res<<endl;return 0;}