結果

問題 No.928 軽減税率?
ユーザー le_panda_noirle_panda_noir
提出日時 2020-07-08 23:09:44
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 2,061 bytes
コンパイル時間 1,016 ms
コンパイル使用メモリ 106,748 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-15 08:30:08
合計ジャッジ時間 2,336 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 7 ms
6,812 KB
testcase_01 AC 6 ms
6,940 KB
testcase_02 AC 2 ms
6,944 KB
testcase_03 AC 2 ms
6,940 KB
testcase_04 AC 7 ms
6,944 KB
testcase_05 AC 6 ms
6,940 KB
testcase_06 AC 7 ms
6,940 KB
testcase_07 AC 6 ms
6,944 KB
testcase_08 AC 6 ms
6,940 KB
testcase_09 AC 6 ms
6,940 KB
testcase_10 AC 6 ms
6,940 KB
testcase_11 AC 7 ms
6,940 KB
testcase_12 AC 6 ms
6,940 KB
testcase_13 AC 6 ms
6,944 KB
testcase_14 AC 7 ms
6,940 KB
testcase_15 AC 7 ms
6,940 KB
testcase_16 AC 6 ms
6,940 KB
testcase_17 AC 6 ms
6,940 KB
testcase_18 AC 6 ms
6,944 KB
testcase_19 AC 6 ms
6,940 KB
testcase_20 AC 6 ms
6,944 KB
testcase_21 AC 6 ms
6,940 KB
testcase_22 WA -
testcase_23 AC 1 ms
6,940 KB
testcase_24 AC 2 ms
6,940 KB
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 WA -
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <algorithm>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <cmath>
#include <iomanip>

using namespace std;
using ll = long long;
using vi = vector<int>;

#define in(v) v; cin >> v;
void ins() {}
template<class T,class... Rest>void ins(T& v,Rest&... rest){cin>>v;ins(rest...);}

#define rep(i,n) for(int i=0,_i=(n);i<_i;++i)
#define rrep(i,n) for(long long i=(n);i>=0;--i)
#define all(f,c,...) (([&](decltype((c)) cccc) { return (f)(begin(cccc), end(cccc), ## __VA_ARGS__); })(c))

// ========== debug ==========
template<class T>ostream& operator<<(ostream& os,const vector<T>& vec){os<<"{";for(size_t i=0;i<vec.size();++i)os<<(i?", ":"")<<vec[i];os<<"}";return os;}
ostream& operator<<(ostream& os,const vector<char>&v){for(size_t i=0;i<v.size();++i)os<<v[i];return os;}
template<class T1,class T2>ostream& operator<<(ostream& os,const pair<T1,T2>& rhs){os<<"("<<rhs.first<<", "<<rhs.second<<")";return os;}

#ifdef LOCAL
void debug() {cerr << "\n";}
template<class First> void debug(const First& first) {cerr<<first<<"\n";}
template<class First, class... Rest> void debug(const First& first, const Rest&... rest) {cerr<<first<<",";debug(rest...);}
void debug2() {cerr << "\n";}
template<class First> void debug2(const First& first) {cerr<<first<<" ";}
template<class First, class... Rest> void debug2(const First& first, const Rest&... rest) {cerr<<first<<" ";debug2(rest...);}
#else
#define debug(...) 42
#define debug2(...) 42
#endif
// ===========================

int main() {
  ll P, Q, A;
  ins(P, Q, A);
  if (P <= Q) {
    cout << 1000000000 << endl;
    return 0;
  }
  ll ok = 1, ng = 1e9+1;
  while (abs(ok - ng) > 1) {
    ll x = (ok + ng) / 2;
    debug(ok, ng, x, (1 + P / 100) * x, (1 + Q / 100) * x + A);
    if (P * x / 100 < Q * x / 100 + A)
      ok = x;
    else
      ng = x;
  }
  int ans = max(0LL, ok - 1001);
  rep(ii, 1e6) {
    ll i = ok + ii - 1e3;
    if (i <= 0)
      continue;
    if (P * i / 100 < Q * i / 100 + A)
      ++ans;
  }
  cout << ans << endl;
  return 0;
}
0