結果

問題 No.928 軽減税率?
ユーザー kimiyuki
提出日時 2019-11-22 21:55:50
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
WA  
実行時間 -
コード長 449 bytes
コンパイル時間 2,009 ms
コンパイル使用メモリ 193,412 KB
最終ジャッジ日時 2025-01-08 04:57:40
ジャッジサーバーID
(参考情報)
judge5 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 22 WA * 12
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP3(i, m, n) for (int i = (m); (i) < (int)(n); ++ (i))
using namespace std;

int solve(int p, int q, int a) {
    constexpr int N = 1e9;
    if (p <= q) return N;
    int cnt = 0;
    REP3 (x, 1, N + 1) {
        cnt += (p * x / 100 < q * x / 100 + a);
        if (cnt + 1000 < x) break;
    }
    return cnt;
}

int main() {
    int p, q, a; cin >> p >> q >> a;
    cout << solve(p, q, a) << endl;
    return 0;
}
0