結果

問題 No.928 軽減税率?
ユーザー uchiiii
提出日時 2020-07-19 23:14:00
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 1,460 bytes
コンパイル時間 2,939 ms
コンパイル使用メモリ 216,824 KB
最終ジャッジ日時 2025-01-12 01:01:30
ジャッジサーバーID
(参考情報)
judge5 / judge3
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#pragma region
#pragma GCC target("avx2")
#pragma GCC optimize("03")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
using namespace std; typedef long double ld; typedef long long ll;
typedef unsigned long long ull;
#define endl "\n"
#define FOR(i,a,b) for(int i=(a);i<=(b);i++)
#define PII pair<int, int>
#define PLL pair<ll, ll>
#define VPII vector<PII>
#define VPLL vector<PLL>
#define ALL(x) (x).begin(), (x).end()
constexpr int INF=1<<30; constexpr ll LINF=1LL<<60; constexpr ll mod=1e9+7; constexpr int NIL = -1;
template<class T>inline bool chmax(T &a, const T &b) { if (a<b) { a = b; return 1; } return 0; }
template<class T>inline bool chmin(T &a, const T &b) { if (b<a) { a = b; return 1; } return 0; }
#pragma endregion
//-------------------

int main(){
    cin.tie(0); ios::sync_with_stdio(false); //cout << fixed << setprecision(15);
    ll p,q,a; cin >> p >> q >> a;
    if(p<=q) {
        cout << (int) 1e9 << endl;
        return 0;
    }
    ll ans = 0;
    if(a > 3) {
        ans += (100*a - 200) / (p-q) - 1;
    }
    // cout << ans << endl;
    auto f = [&](ll x, ll p) -> ld{
        return (ld) p * (ld)x / 100.0 + (ld)x;
    };
    ll soko = ans+1;
    for(ll x=soko; x < soko+1000; x++) {
        ld left = f(x, p);
        ld right = f(x,q) + (ld) a;
        // cout << left << " " << right << endl;
        if( (ll) left < (ll) right) {
            ans += 1;
        }
    }

    cout << ans << endl;
    return 0;
}
0