結果
| 問題 |
No.928 軽減税率?
|
| コンテスト | |
| ユーザー |
kazuma
|
| 提出日時 | 2019-11-22 22:43:33 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 27 ms / 1,000 ms |
| コード長 | 675 bytes |
| コンパイル時間 | 2,238 ms |
| コンパイル使用メモリ | 192,400 KB |
| 最終ジャッジ日時 | 2025-01-08 05:18:25 |
|
ジャッジサーバーID (参考情報) |
judge5 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 34 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
const ll MAX = 1e9;
int main()
{
ios::sync_with_stdio(false), cin.tie(0);
int P, Q, A;
cin >> P >> Q >> A;
if (A == 0) {
if (P >= Q) {
cout << 0 << endl;
return 0;
}
int cnt = MAX;
for (ll i = 1; i <= 100; i++) {
cnt -= (Q * i / 100 <= P * i / 100);
}
cout << cnt << endl;
return 0;
}
if (P == Q) {
if (A == 0) {
cout << 0 << endl;
return 0;
}
cout << MAX << endl;
return 0;
}
if (P < Q) {
cout << MAX << endl;
return 0;
}
int cnt = 0;
for (ll i = 1; i <= 10000000; i++) {
cnt += (Q * i / 100 + A > P * i / 100);
}
cout << cnt << endl;
return 0;
}
kazuma