結果

問題 No.928 軽減税率?
ユーザー beetbeet
提出日時 2019-11-22 22:08:00
言語 C++17
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 71 ms / 1,000 ms
コード長 576 bytes
コンパイル時間 1,942 ms
コンパイル使用メモリ 201,784 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 11:35:11
合計ジャッジ時間 4,931 ms
ジャッジサーバーID
(参考情報)
judge5 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 51 ms
5,248 KB
testcase_01 AC 51 ms
5,376 KB
testcase_02 AC 66 ms
5,376 KB
testcase_03 AC 68 ms
5,376 KB
testcase_04 AC 51 ms
5,376 KB
testcase_05 AC 52 ms
5,376 KB
testcase_06 AC 53 ms
5,376 KB
testcase_07 AC 52 ms
5,376 KB
testcase_08 AC 54 ms
5,376 KB
testcase_09 AC 53 ms
5,376 KB
testcase_10 AC 52 ms
5,376 KB
testcase_11 AC 52 ms
5,376 KB
testcase_12 AC 51 ms
5,376 KB
testcase_13 AC 53 ms
5,376 KB
testcase_14 AC 51 ms
5,376 KB
testcase_15 AC 51 ms
5,376 KB
testcase_16 AC 54 ms
5,376 KB
testcase_17 AC 54 ms
5,376 KB
testcase_18 AC 54 ms
5,376 KB
testcase_19 AC 53 ms
5,376 KB
testcase_20 AC 53 ms
5,376 KB
testcase_21 AC 54 ms
5,376 KB
testcase_22 AC 51 ms
5,376 KB
testcase_23 AC 69 ms
5,376 KB
testcase_24 AC 67 ms
5,376 KB
testcase_25 AC 66 ms
5,376 KB
testcase_26 AC 67 ms
5,376 KB
testcase_27 AC 68 ms
5,376 KB
testcase_28 AC 68 ms
5,376 KB
testcase_29 AC 66 ms
5,376 KB
testcase_30 AC 66 ms
5,376 KB
testcase_31 AC 71 ms
5,376 KB
testcase_32 AC 56 ms
5,376 KB
testcase_33 AC 66 ms
5,376 KB
testcase_34 AC 65 ms
5,376 KB
testcase_35 AC 66 ms
5,376 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#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 HERE
signed 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;
}
0