結果
| 問題 |
No.928 軽減税率?
|
| コンテスト | |
| ユーザー |
Bwambocos
|
| 提出日時 | 2019-11-22 22:26:30 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 831 bytes |
| コンパイル時間 | 2,227 ms |
| コンパイル使用メモリ | 193,080 KB |
| 最終ジャッジ日時 | 2025-01-08 05:14:03 |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 22 WA * 12 |
ソースコード
#include "bits/stdc++.h"
#define in std::cin
#define out std::cout
#define rep(i,N) for(LL i=0;i<N;++i)
typedef long long int LL;
long double P, Q, A;
bool check(LL x)
{
LL res1 = (1 + P / 100) * x;
LL res2 = (1 + Q / 100) * x + A;
return res1 < res2;
}
int main()
{
in >> P >> Q >> A;
LL left = 0, right = 1000000001;
while (right - left > 1)
{
auto mid = (left + right) / 2;
if (check(mid)) left = mid;
else right = mid;
}
LL ans = left;
for (LL x = left; x >= left - 10000000; --x)
{
if (x <= 0) break;
LL res1 = (1 + P / 100) * x;
LL res2 = (1 + Q / 100) * x + A;
if (res1 >= res2) --ans;
}
for (LL x = left + 1; x <= left + 10000000; ++x)
{
if (x > 1000000000) break;
LL res1 = (1 + P / 100) * x;
LL res2 = (1 + Q / 100) * x + A;
if (res1 < res2) ++ans;
}
out << ans << std::endl;
}
Bwambocos