結果
問題 |
No.1453 手助け
|
ユーザー |
![]() |
提出日時 | 2022-08-03 15:51:46 |
言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
結果 |
WA
|
実行時間 | - |
コード長 | 625 bytes |
コンパイル時間 | 618 ms |
コンパイル使用メモリ | 71,888 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-13 09:11:44 |
合計ジャッジ時間 | 1,447 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 16 WA * 5 |
ソースコード
#include <iostream> #include <vector> #include <map> #include<string> #define ll long long using namespace std; int main() { int a,b,c,d,e,cnt; int ans=0; cin>>a>>b>>c>>d>>e; int cost=d; cnt=(b-c)*a; if(cnt==1 or cnt==0) ans=cnt*d; else { ans+=d; for (int i=2;i<=cnt;i++){ if(i%10!=0) { ans+=cost; } else if(i%10==0 and e<=cost) { cost=(d-e); ans+=cost; } else if(i%10==0 and e>cost){ ans+=cost; } } } cout<<ans<<endl; return 0; }