結果
問題 |
No.928 軽減税率?
|
ユーザー |
|
提出日時 | 2019-11-22 21:35:23 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 345 bytes |
コンパイル時間 | 513 ms |
コンパイル使用メモリ | 64,384 KB |
実行使用メモリ | 5,248 KB |
最終ジャッジ日時 | 2024-10-11 02:58:11 |
合計ジャッジ時間 | 1,546 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
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 Llim=L<200?0:L-200; long ans=Llim; for(long i=Llim+1;i<Llim+1000&&i<=(long)1e9;i++) { if(i*(100+P)/100<i*(100+Q)/100+A)ans++; } cout<<ans<<endl; }