結果
| 問題 | No.928 軽減税率? |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-22 21:37:27 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.89.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 371 bytes |
| 記録 | |
| コンパイル時間 | 681 ms |
| コンパイル使用メモリ | 66,308 KB |
| 実行使用メモリ | 6,824 KB |
| 最終ジャッジ日時 | 2024-10-11 03:00:38 |
| 合計ジャッジ時間 | 1,703 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 24 WA * 10 |
コンパイルメッセージ
main.cpp:4:1: warning: ISO C++ forbids declaration of 'main' with no type [-Wreturn-type]
4 | main()
| ^~~~
ソースコード
#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++;
}
cout<<ans<<endl;
}