結果

問題 No.928 軽減税率?
ユーザー 🍮かんプリン🍮かんプリン
提出日時 2019-11-22 22:13:35
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 1,277 bytes
コンパイル時間 1,281 ms
コンパイル使用メモリ 159,496 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 11:42:30
合計ジャッジ時間 2,010 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include "bits/stdc++.h"
#define REP(i, n) for(int i = 0; i < int(n); i++)
#define FOR(i,n,m) for(int i = int(n); i < int(m); i++)
using namespace std;
typedef long long ll;
const int MOD = 1e9 + 7;
const int INF = 1e9 + 6;
const ll LLINF = 1e18 + 1;

int p, q, a;

bool f(int mid) {
    int b = (int)((1 + p / 100.0)*mid);
    int c = (int)((1 + q / 100.0)*mid) + a;
    return c > b;
}

int main() {
    cin >> p >> q >> a;
    if (p < q) {
        if (a != 0) {
            puts("1000000000");
        }
        else {
            int ans = 0;
            int k = int((a + 1) * 100.0 / (p - q));
            for (int i = ans + 1; i <= k + 1; i++) {
                if (f(i)) ans++;
            }
            cout << ans << endl;
        }
        return 0;
    }
    else if (p == q) {
        if (a == 0) {
            puts("0");
        }
        else {
            puts("1000000000");
        }
        return 0;
    }
    if (a != 0) {
        vector<int> n(p);
        cout << n[p] << endl;
        int ans = int((a - 1)*100.0 / (p - q));
        int k = int((a + 1) * 100.0 / (p - q));
        for (int i = ans + 1; i <= k + 1; i++) {
            if (f(i)) ans++;
        }
        cout << ans << endl;
    }
    else {
        cout << 0 << endl;
    }
    return 0;
}
0