結果

問題 No.928 軽減税率?
ユーザー 0w1
提出日時 2020-11-15 14:11:02
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
AC  
実行時間 4 ms / 1,000 ms
コード長 543 bytes
コンパイル時間 1,671 ms
コンパイル使用メモリ 192,616 KB
最終ジャッジ日時 2025-01-16 00:55:34
ジャッジサーバーID
(参考情報)
judge4 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2
other AC * 34
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int P, Q, A; {
    cin >> P >> Q >> A;
  }

  if (P == Q) {
    if (A) cout << 1000000000 << endl;
    else cout << 0 << endl;
  } else if (P < Q) {
    int res = 1e9;
    for (int x = 1; x < 200; ++x) {
      res -= (x + Q * x / 100 + A) <= (x + P * x / 100);
    }
    cout << res << endl;
  } else {
    int x = A * 100 / (P - Q) + 200;
    int res = 0;
    while (x > 0) {
      res += (x + Q * x / 100 + A) > (x + P * x / 100);
      --x;
    }
    cout << res << endl;
  }
}
0