結果

問題 No.928 軽減税率?
ユーザー season1618season1618
提出日時 2019-11-22 22:02:25
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 760 bytes
コンパイル時間 1,639 ms
コンパイル使用メモリ 163,204 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-19 11:27:08
合計ジャッジ時間 2,994 ms
ジャッジサーバーID
(参考情報)
judge4 / judge2
このコードへのチャレンジ
(要ログイン)

テストケース

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

ソースコード

diff #

#include<bits/stdc++.h>
using namespace std;
#define rep(i,x,y) for(int i=x;i<y;i++)
#define range(a) (a).begin(),(a).end()
#define print(A,n) rep(i,0,n){cout<<(i ? " ":"")<<A[i];}cout<<endl;
#define pprint(A,m,n) rep(j,0,m){print(A[j],n);}
const long mod=1e9+7;
const int size=1e5;
const long inf=1e9;
int gauss(double x,int y){
	return x*y;
}
int main(){
	double p,q,s; cin>>p>>q>>s;
	p=1+p/100; q=1+q/100;
	int a=0,b=inf+1;
	while(b-a>1){
		if(gauss(p,(a+b)/2)<gauss(q,(a+b)/2)+s) a=(a+b)/2;
		else b=(a+b)/2;
	}int cnt=0;
    if(a<100){
        rep(i,1,200){
            if(gauss(p,i)<gauss(q,i)+s) cnt++;
        }cout<<cnt<<endl;
    }else{
        rep(i,a-99,a+100){
            if(gauss(p,i)<gauss(q,i)+s) cnt++;
        }cout<<a-100+cnt<<endl;
    }
}
0