結果
| 問題 |
No.1453 手助け
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2021-08-25 22:54:32 |
| 言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
| 結果 |
WA
|
| 実行時間 | - |
| コード長 | 347 bytes |
| コンパイル時間 | 1,965 ms |
| コンパイル使用メモリ | 191,544 KB |
| 最終ジャッジ日時 | 2025-01-24 01:51:58 |
|
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 10 WA * 11 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
#define rep(i,l,r) for(int i=(l);i<(r);++i)
typedef long long ll;
int main(){
int a,b,c,d,e; cin>>a>>b>>c>>d>>e;
if(b-c==0) cout<<0<<endl;
else if(d<e) cout<<(b-c)*a*d<<endl;
else {
int r=(b-c)*a;
int x=d, ans=d;
rep(i,1,r){
if(i%10==0&&e<=x) x-=e;
ans+=x;
}
cout<<ans<<endl;
}
}