結果
| 問題 | No.928 軽減税率? |
| コンテスト | |
| ユーザー |
koi_kotya
|
| 提出日時 | 2019-11-22 21:52:30 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 794 bytes |
| 記録 | |
| コンパイル時間 | 1,630 ms |
| コンパイル使用メモリ | 167,388 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-10-11 03:23:43 |
| 合計ジャッジ時間 | 2,605 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 10 |
ソースコード
#include<bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int,int> P;
#define p_ary(ary,a,b) do { cout << "["; for (int count = (a);count < (b);++count) cout << ary[count] << ((b)-1 == count ? "" : ", "); cout << "]\n"; } while(0)
#define p_map(map,it) do {cout << "{";for (auto (it) = map.begin();;++(it)) {if ((it) == map.end()) {cout << "}\n";break;}else cout << "" << (it)->first << "=>" << (it)->second << ", ";}}while(0)
int main() {
ll p,q,a;
cin >> p >> q >> a;
ll ok = 0,ng = 1e9;
while (ng-ok > 1) {
ll mid = (ok+ng)/2;
(p*mid/100 < q*mid/100+a ? ok : ng) = mid;
}
ll ans = max(0LL,ok-10000);
for (ll i = max(1LL,ok-10000+1);i <= min((ll)1e9,ok+10000);++i) if (p*i/100 < q*i/100+a) ans++;
cout << ans << endl;
}
koi_kotya