結果

問題 No.928 軽減税率?
コンテスト
ユーザー Pachicobue
提出日時 2019-10-29 04:29:35
言語 C++17
(gcc 15.3.0 + boost 1.92.0 + ACL)
コンパイル:
g++-15 -O2 -fplugin=/usr/lib/yukicoder/noavx512-gcc15.so -lm -std=c++17 -Wuninitialized -DONLINE_JUDGE -o a.out _filename_
実行:
./a.out
結果
WA  
実行時間 -
コード長 662 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 1,361 ms
コンパイル使用メモリ 209,544 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-10-24 13:12:24
合計ジャッジ時間 3,348 ms
ジャッジサーバーID
(参考情報)
judge2_0 / judge6_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 24 WA * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <bits/stdc++.h>
using usize = std::size_t;
int main()
{
    constexpr usize max = 1000000000;
    usize p, q, a;
    std::cin >> p >> q >> a;
    if (p < q) { return std::cout << max << std::endl, 0; }
    if (p == q) { return std::cout << (a == 0 ? 0 : max) << std::endl, 0; }
    const usize l = (a <= 1 ? 0 : (100UL * a - 100UL) / (p - q));
    const usize r = (100UL * a + p - q - 1) / (p - q);
    usize ans     = l;
    for (usize x = l + 1; x < r; x++) {
        const usize eat_in   = x * p / 100;
        const usize take_out = x * q / 100 + a;
        if (eat_in < take_out) { ans++; }
    }
    std::cout << ans << std::endl;
    return 0;
}
0