結果
問題 | No.928 軽減税率? |
ユーザー |
![]() |
提出日時 | 2019-12-03 12:13:28 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 1,000 ms |
コード長 | 877 bytes |
コンパイル時間 | 1,536 ms |
コンパイル使用メモリ | 166,428 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-11-26 22:46:32 |
合計ジャッジ時間 | 2,843 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i, n) for (int i = 0; i < (n); i++)typedef long long ll;typedef pair<int, int> pii;typedef vector<ll> vll;typedef vector<int> vi;typedef vector<vector<int>> vvi;typedef vector<vector<ll>> vvll;const ll inf = 1e16;const ll md = 1000000007;int main() {int p,q,a;cin>>p>>q>>a;//店内Pと家Qが同じ場合if(p==q){if(a==0){puts("0");}else{puts("1000000000");}return 0;}//店内Pの方が小さい場合if(p<q){if(a==0){ll ans=1000000000;for(int n=1;n<=99;n++) if(p*n/100==q*n/100) ans--;cout<<ans<<endl;}else{puts("1000000000");}return 0;}//店内Pの方が大きい場合int ans=0;for (int x=1;x<=1000005;x++){if ((100+p)*x/100<(100+q)*x/100+a) ans++;}cout<<ans<<endl;return 0;}