結果
問題 | No.1453 手助け |
ユーザー |
|
提出日時 | 2021-03-31 21:03:06 |
言語 | C++17 (gcc 13.3.0 + boost 1.87.0) |
結果 |
AC
|
実行時間 | 5 ms / 2,000 ms |
コード長 | 522 bytes |
コンパイル時間 | 3,018 ms |
コンパイル使用メモリ | 191,320 KB |
最終ジャッジ日時 | 2025-01-20 02:22:25 |
ジャッジサーバーID (参考情報) |
judge2 / judge5 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 21 |
ソースコード
#include <bits/stdc++.h>using namespace std;#define rep(i, n) for(int i = 0; i < int(n); i++)using ll = long long;using P = pair<int, int>;int main() {cin.tie(0);ios_base::sync_with_stdio(false);int a, b, c, d, e;cin >> a >> b >> c >> d >> e;int kosuu = (b - c) * a;int ans = 0;int cost = -1;rep(i, kosuu) {if(i == 0) cost = d;else if (i % 10 == 9 && e <= cost)cost -= e;ans += cost;}cout << ans << endl;return 0;}