結果
問題 | No.928 軽減税率? |
ユーザー | kotatsugame |
提出日時 | 2019-11-22 21:41:29 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 11 ms / 1,000 ms |
コード長 | 449 bytes |
コンパイル時間 | 689 ms |
コンパイル使用メモリ | 64,884 KB |
実行使用メモリ | 6,824 KB |
最終ジャッジ日時 | 2024-10-11 03:07:36 |
合計ジャッジ時間 | 2,762 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 34 |
コンパイルメッセージ
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++; } for(long i=1;i<=114514&&i<=Llim;i++)if(i*(100+P)/100>=i*(100+Q)/100+A)ans--; cout<<ans<<endl; }