結果

問題 No.928 軽減税率?
ユーザー kimiyukikimiyuki
提出日時 2019-11-22 22:03:41
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 714 bytes
コンパイル時間 2,169 ms
コンパイル使用メモリ 194,152 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 11:29:14
合計ジャッジ時間 3,333 ms
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
5,248 KB
testcase_01 AC 2 ms
5,376 KB
testcase_02 AC 1 ms
5,376 KB
testcase_03 AC 1 ms
5,376 KB
testcase_04 AC 1 ms
5,376 KB
testcase_05 AC 2 ms
5,376 KB
testcase_06 AC 3 ms
5,376 KB
testcase_07 AC 1 ms
5,376 KB
testcase_08 AC 1 ms
5,376 KB
testcase_09 AC 2 ms
5,376 KB
testcase_10 AC 2 ms
5,376 KB
testcase_11 AC 1 ms
5,376 KB
testcase_12 AC 2 ms
5,376 KB
testcase_13 AC 2 ms
5,376 KB
testcase_14 AC 2 ms
5,376 KB
testcase_15 AC 2 ms
5,376 KB
testcase_16 AC 2 ms
5,376 KB
testcase_17 AC 3 ms
5,376 KB
testcase_18 AC 3 ms
5,376 KB
testcase_19 AC 4 ms
5,376 KB
testcase_20 AC 4 ms
5,376 KB
testcase_21 AC 6 ms
5,376 KB
testcase_22 WA -
testcase_23 AC 3 ms
5,376 KB
testcase_24 AC 2 ms
5,376 KB
testcase_25 AC 2 ms
5,376 KB
testcase_26 AC 3 ms
5,376 KB
testcase_27 AC 3 ms
5,376 KB
testcase_28 AC 3 ms
5,376 KB
testcase_29 AC 2 ms
5,376 KB
testcase_30 AC 3 ms
5,376 KB
testcase_31 AC 3 ms
5,376 KB
testcase_32 WA -
testcase_33 AC 2 ms
5,376 KB
testcase_34 AC 2 ms
5,376 KB
testcase_35 AC 2 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

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;
    int cnt = 0;
    if (p <= q) {
        if (a >= 1) {
            cnt = N;
        } else {
            constexpr int L = 100000;
            REP3 (x, 1, L) {
                cnt += (p * x / 100 < q * x / 100 + a);
            }
            cnt += N + 1 - L;
        }
    } else {
        REP3 (x, 1, N + 1) {
            cnt += (p * x / 100 < q * x / 100 + a);
            if (cnt + 10000 < x) break;
        }
    }
    return cnt;
}

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