結果
問題 | No.928 軽減税率? |
ユーザー |
![]() |
提出日時 | 2019-11-27 21:54:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 1,164 bytes |
コンパイル時間 | 1,420 ms |
コンパイル使用メモリ | 167,616 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-11-15 16:53:30 |
合計ジャッジ時間 | 2,445 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | WA * 2 |
other | AC * 3 WA * 31 |
ソースコード
#include <bits/stdc++.h> #include <set> #include <cstdio> #include <vector> #include <iostream> #include <utility> #define fir first #define sec second #define get(n) scanf("%d",&n); #define gets(s) string s;cin >> (s); #define All(s) (c).begin(), (c).end() #define chmin(x, y) x = min(x, y); #define chmax(x, y) x = max(x, y); #define rep(i, j) for (int (i)=0;(i)<(j);(i)++) #define repk(i, j, k) for(int (i)=(j);(i)<(k);(i)++) #define dump(x) cout << #x << " = " << (x) << endl; #define debug(x) cout << #x << " = " << (x) << " (L" << __LINE__ << ")" << " " << __FILE__ << endl; using namespace std; typedef long long int ll; const ll INF = 10241024; int P,Q,A; void input(){ cin >> P >> Q >> A; } bool updown(int x){ int a = (Q - P)*x; int b = A + floor(a/100); if(b>0)return true; else return false; } void solve(){ input(); int ans = 1e9; if(Q > P){ cout << ans << endl; return ; } int r = 1, l = 1e9; while(r+1<l){ int c = (r+l)/2; if(updown(c))l = c; else r = c; } ans -= r; cout << ans << endl; return; } int main () { solve(); return 0; }