結果
| 問題 | No.928 軽減税率? |
| コンテスト | |
| ユーザー |
risujiroh
|
| 提出日時 | 2019-11-22 21:34:47 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 557 bytes |
| 記録 | |
| コンパイル時間 | 1,521 ms |
| コンパイル使用メモリ | 166,212 KB |
| 実行使用メモリ | 5,248 KB |
| 最終ジャッジ日時 | 2024-10-11 02:56:50 |
| 合計ジャッジ時間 | 2,622 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 WA * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
int main() {
int p, q, a;
cin >> p >> q >> a;
if (p <= q) {
cout << (int)1e9 << '\n';
return 0;
}
auto chk = [&](long long x) -> bool {
return x * (100 + p) / 100 < x * (100 + q) / 100 + a;
};
int ok = 0, ng = 1e9 + 1;
while (ng - ok > 1) {
int mid = (ok + ng) / 2;
(chk(mid) ? ok : ng) = mid;
}
const int w = 1e6;
int l = max(ok - w, 1), u = min<int>(ok + w, 1e9);
int res = (l - 1);
for (int x = l; x <= u; ++x) {
res += chk(x);
}
cout << res << '\n';
}
risujiroh