結果

問題 No.928 軽減税率?
ユーザー Pachicobue
提出日時 2019-11-20 19:00:18
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 47 ms / 1,000 ms
コード長 666 bytes
コンパイル時間 907 ms
コンパイル使用メモリ 69,760 KB
最終ジャッジ日時 2025-01-08 04:12:54
ジャッジサーバーID
(参考情報)
judge1 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
int main()
{
    constexpr int max = 1000000000;
    int p, q, a;
    std::cin >> p >> q >> a;
    if (p == q) {
        std::cout << (a == 0 ? 0 : max) << std::endl;
    } else if (p < q) {
        const int rep = 100;
        int ans       = max - rep;
        for (int x = 1; x <= rep; x++) {
            if (x * p / 100 < x * q / 100 + a) { ans++; }
        }
        std::cout << ans << std::endl;
    } else {
        const int rep = 1000000;
        int ans       = 0;
        for (int x = 1; x <= rep; x++) {
            if (x * p / 100 < x * q / 100 + a) { ans++; }
        }
        std::cout << ans << std::endl;
    }
    return 0;
}
0