結果

問題 No.928 軽減税率?
ユーザー amaridekinaiamaridekinai
提出日時 2019-11-24 16:38:14
言語 C++11
(gcc 11.4.0)
結果
WA  
実行時間 -
コード長 410 bytes
コンパイル時間 1,212 ms
コンパイル使用メモリ 158,476 KB
実行使用メモリ 6,948 KB
最終ジャッジ日時 2024-04-20 08:55:32
合計ジャッジ時間 2,399 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
const ll MAX_X = 1e9;
int main(){
  ll P,Q,A; cin >> P >> Q >> A;
  
  if( Q >= P){ cout << MAX_X << endl; return 0;}
  
  ll left = 0; ll right = MAX_X;
  
  while(right-left > 1){
    
    ll x =(right+left)/2;
    
    if( (ll)((x*P)/100) - (ll)((x*Q)/100) < A){  left = x;}
    else{ right = x;}
  }
  
  cout << left << endl; return 0;
}
0