結果

問題 No.928 軽減税率?
ユーザー kimiyukikimiyuki
提出日時 2019-11-22 22:13:20
言語 C++17(clang)
(17.0.6 + boost 1.83.0)
結果
AC  
実行時間 952 ms / 1,000 ms
コード長 640 bytes
コンパイル時間 2,213 ms
コンパイル使用メモリ 135,224 KB
実行使用メモリ 4,384 KB
最終ジャッジ日時 2023-08-20 13:29:58
合計ジャッジ時間 35,526 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 952 ms
4,376 KB
testcase_01 AC 841 ms
4,380 KB
testcase_02 AC 857 ms
4,376 KB
testcase_03 AC 816 ms
4,380 KB
testcase_04 AC 830 ms
4,380 KB
testcase_05 AC 815 ms
4,380 KB
testcase_06 AC 817 ms
4,376 KB
testcase_07 AC 815 ms
4,376 KB
testcase_08 AC 813 ms
4,384 KB
testcase_09 AC 811 ms
4,376 KB
testcase_10 AC 812 ms
4,376 KB
testcase_11 AC 861 ms
4,380 KB
testcase_12 AC 819 ms
4,376 KB
testcase_13 AC 817 ms
4,380 KB
testcase_14 AC 813 ms
4,376 KB
testcase_15 AC 809 ms
4,380 KB
testcase_16 AC 812 ms
4,376 KB
testcase_17 AC 809 ms
4,380 KB
testcase_18 AC 819 ms
4,380 KB
testcase_19 AC 817 ms
4,376 KB
testcase_20 AC 809 ms
4,376 KB
testcase_21 AC 828 ms
4,384 KB
testcase_22 AC 823 ms
4,380 KB
testcase_23 AC 817 ms
4,380 KB
testcase_24 AC 829 ms
4,380 KB
testcase_25 AC 824 ms
4,380 KB
testcase_26 AC 845 ms
4,376 KB
testcase_27 AC 837 ms
4,376 KB
testcase_28 AC 818 ms
4,380 KB
testcase_29 AC 828 ms
4,384 KB
testcase_30 AC 836 ms
4,380 KB
testcase_31 AC 822 ms
4,384 KB
testcase_32 AC 838 ms
4,376 KB
testcase_33 AC 830 ms
4,380 KB
testcase_34 AC 870 ms
4,380 KB
testcase_35 AC 843 ms
4,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
#define REP(i, n) for (int i = 0; (i) < (int)(n); ++ (i))
#define ALL(x) std::begin(x), std::end(x)
using namespace std;

int solve(int64_t p, int64_t q, int64_t a) {
    constexpr int64_t N = 1e9;
    array<int, 100> cnt = {};
    REP (x, N / 100) {
#pragma unroll 100
        REP (y, 100) {
            cnt[y] += (p * x + p * y / 100 < q * x + q * y / 100 + a);
        }
    }
    cnt[0] -= (p * 0 / 100 < q * 0 / 100 + a);
    cnt[0] += (p * N / 100 < q * N / 100 + a);
    return accumulate(ALL(cnt), 0);
}

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