結果

問題 No.928 軽減税率?
ユーザー CleyLCleyL
提出日時 2022-01-27 22:23:10
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 725 bytes
コンパイル時間 491 ms
コンパイル使用メモリ 65,324 KB
実行使用メモリ 4,504 KB
最終ジャッジ日時 2023-08-27 00:41:10
合計ジャッジ時間 1,877 ms
ジャッジサーバーID
(参考情報)
judge13 / judge12
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <iostream>
using namespace std;
int main(){
  long long a,b,c;cin>>a>>b>>c;
  if(a==b){
    if(c){
      cout << 1000000000 << endl;
    }else{
      cout << 0 << endl;
    }
    return 0;
  }
  long long mx = 1000000001;
  long long mn = 1;
  while(mx-mn > 1){
    long long ce = (mx+mn)/2;
    if(ce*(100+a)/100 < ce*(100+b)/100+c){
      mn = ce;
    }else{
      mx = ce;
    }
  }
  long long mx2 = 1000000001;
  long long mn2 = 1;
  while(mx2-mn2 > 1){
    long long ce = (mx2+mn2)/2;
    if(ce*(100+a)/100 <= ce*(100+b)/100+c){
      mn2 = ce;
    }else{
      mx2 = ce;
    }
  }
  int ans = mn;
  for(int i = mn+1;mn2 >= i;i++){
    if(i*(100+a)/100 < i*(100+b)/100+c)ans++;
  }
  cout << ans << endl;
  

}
0