結果

問題 No.928 軽減税率?
ユーザー kotatsugamekotatsugame
提出日時 2019-11-22 21:41:29
言語 C++14
(gcc 12.3.0 + boost 1.83.0)
結果
AC  
実行時間 9 ms / 1,000 ms
コード長 449 bytes
コンパイル時間 464 ms
コンパイル使用メモリ 64,644 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-08-01 11:16:42
合計ジャッジ時間 1,792 ms
ジャッジサーバーID
(参考情報)
judge14 / judge12
このコードへのチャレンジ(β)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 AC 2 ms
4,376 KB
testcase_02 AC 4 ms
4,376 KB
testcase_03 AC 2 ms
4,380 KB
testcase_04 AC 3 ms
4,380 KB
testcase_05 AC 4 ms
4,376 KB
testcase_06 AC 4 ms
4,380 KB
testcase_07 AC 6 ms
4,376 KB
testcase_08 AC 5 ms
4,380 KB
testcase_09 AC 6 ms
4,376 KB
testcase_10 AC 5 ms
4,376 KB
testcase_11 AC 4 ms
4,376 KB
testcase_12 AC 7 ms
4,376 KB
testcase_13 AC 4 ms
4,380 KB
testcase_14 AC 8 ms
4,376 KB
testcase_15 AC 4 ms
4,376 KB
testcase_16 AC 6 ms
4,380 KB
testcase_17 AC 9 ms
4,380 KB
testcase_18 AC 9 ms
4,376 KB
testcase_19 AC 8 ms
4,376 KB
testcase_20 AC 8 ms
4,376 KB
testcase_21 AC 9 ms
4,380 KB
testcase_22 AC 1 ms
4,380 KB
testcase_23 AC 2 ms
4,376 KB
testcase_24 AC 5 ms
4,376 KB
testcase_25 AC 1 ms
4,376 KB
testcase_26 AC 2 ms
4,380 KB
testcase_27 AC 2 ms
4,376 KB
testcase_28 AC 2 ms
4,376 KB
testcase_29 AC 1 ms
4,376 KB
testcase_30 AC 2 ms
4,380 KB
testcase_31 AC 2 ms
4,380 KB
testcase_32 AC 1 ms
4,376 KB
testcase_33 AC 1 ms
4,376 KB
testcase_34 AC 2 ms
4,376 KB
testcase_35 AC 1 ms
4,380 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
main.cpp:4:1: 警告: ISO C++ では型の無い ‘main’ の宣言を禁止しています [-Wreturn-type]
    4 | main()
      | ^~~~

ソースコード

diff #

#include<iostream>
using namespace std;
long P,Q,A;
main()
{
	cin>>P>>Q>>A;
	long L=0,R=1e9+1;
	while(R-L>1)
	{
		long M=(L+R)/2;
		if(M*(100+P)/100<M*(100+Q)/100+A)L=M;
		else R=M;
	}
	long T=150*A>1000?150*A:1000;
	long Llim=L<T?0:L-T;
	long ans=Llim;
	for(long i=Llim+1;i<Llim+2*T&&i<=(long)1e9;i++)
	{
		if(i*(100+P)/100<i*(100+Q)/100+A)ans++;
	}
	for(long i=1;i<=114514&&i<=Llim;i++)if(i*(100+P)/100>=i*(100+Q)/100+A)ans--;
	cout<<ans<<endl;
}
0