結果

問題 No.928 軽減税率?
ユーザー beetbeet
提出日時 2019-11-22 21:48:56
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 694 bytes
コンパイル時間 1,767 ms
コンパイル使用メモリ 195,020 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-19 11:00:47
合計ジャッジ時間 27,347 ms
ジャッジサーバーID
(参考情報)
judge1 / judge3
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 677 ms
6,816 KB
testcase_01 AC 706 ms
6,812 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 AC 684 ms
6,940 KB
testcase_05 AC 678 ms
6,940 KB
testcase_06 AC 674 ms
6,944 KB
testcase_07 AC 668 ms
6,940 KB
testcase_08 AC 669 ms
6,940 KB
testcase_09 AC 678 ms
6,944 KB
testcase_10 AC 672 ms
6,944 KB
testcase_11 AC 673 ms
6,944 KB
testcase_12 AC 671 ms
6,944 KB
testcase_13 AC 673 ms
6,940 KB
testcase_14 AC 691 ms
6,944 KB
testcase_15 AC 675 ms
6,940 KB
testcase_16 AC 679 ms
6,944 KB
testcase_17 AC 686 ms
6,944 KB
testcase_18 AC 690 ms
6,944 KB
testcase_19 AC 689 ms
6,944 KB
testcase_20 AC 670 ms
6,944 KB
testcase_21 AC 676 ms
6,940 KB
testcase_22 AC 693 ms
6,940 KB
testcase_23 AC 342 ms
6,940 KB
testcase_24 WA -
testcase_25 WA -
testcase_26 WA -
testcase_27 WA -
testcase_28 WA -
testcase_29 WA -
testcase_30 WA -
testcase_31 WA -
testcase_32 AC 677 ms
6,944 KB
testcase_33 WA -
testcase_34 WA -
testcase_35 WA -
権限があれば一括ダウンロードができます

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
using Int = long long;
template<typename T1,typename T2> inline void chmin(T1 &a,T2 b){if(a>b) a=b;}
template<typename T1,typename T2> inline void chmax(T1 &a,T2 b){if(a<b) a=b;}

//INSERT ABOVE HERE
const Int MAX = 1e9;
Int p,q,a;
Int check(Int k){
  return (k*p/100)<(k*q/100+a);
}
signed main(){
  cin>>p>>q>>a;
  Int l=0,r=MAX;
  while(l+1<r){
    Int m=(l+r)>>1;
    if(p>=q){
      if(check(m)) l=m;
      else r=m;
    }else{
      if(check(m)) r=m;
      else l=m;
    }
  }
  const Int LEN=1e8;
  Int pos=l-LEN;
  chmax(pos,1);
  Int ans=pos-1;
  for(Int i=0;pos+i<=MAX&&i<LEN*2;i++)
    ans+=check(pos+i);
  cout<<ans<<endl;
  return 0;
}
0