結果
問題 | No.928 軽減税率? |
ユーザー |
![]() |
提出日時 | 2019-11-22 22:08:00 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 87 ms / 1,000 ms |
コード長 | 576 bytes |
コンパイル時間 | 2,478 ms |
コンパイル使用メモリ | 198,260 KB |
最終ジャッジ日時 | 2025-01-08 05:02:35 |
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
ソースコード
#include<bits/stdc++.h>using Int = long long;using namespace std;struct FastIO{FastIO(){cin.tie(0);ios::sync_with_stdio(0);}}fastio_beet;Int p,q,a;Int check(Int k){return (k*p/100)<(k*q/100+a);}//INSERT ABOVE HEREsigned main(){cin>>p>>q>>a;const Int MAX = 1e9;vector<Int> ds;for(Int i=0;i<100;i++)ds.emplace_back((i*p/100)-(i*q/100));sort(ds.begin(),ds.end());Int ans=check(MAX)-check(0);for(Int i=0;i<MAX;i+=100)ans+=lower_bound(ds.begin(),ds.end(),(q-p)*i/100+a)-ds.begin();cout<<ans<<endl;return 0;}