結果
| 問題 |
No.1453 手助け
|
| コンテスト | |
| ユーザー |
sorag
|
| 提出日時 | 2022-08-03 15:54:16 |
| 言語 | C++14 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 622 bytes |
| コンパイル時間 | 573 ms |
| コンパイル使用メモリ | 72,452 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-13 09:14:07 |
| 合計ジャッジ時間 | 1,427 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 21 |
ソースコード
#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-=e; ans+=cost;
}
else if(i%10==0 and e>cost){
ans+=cost;
}
}
}
cout<<ans<<endl;
return 0;
}
sorag