結果

問題 No.1453 手助け
ユーザー hanyu
提出日時 2021-04-01 11:42:35
言語 C++17
(gcc 13.3.0 + boost 1.87.0)
結果
RE  
実行時間 -
コード長 436 bytes
コンパイル時間 1,965 ms
コンパイル使用メモリ 194,048 KB
最終ジャッジ日時 2025-01-20 04:55:21
ジャッジサーバーID
(参考情報)
judge2 / judge4
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 2 RE * 1
other AC * 19 RE * 2
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <bits/stdc++.h>
using namespace std;

int main() {
  int a, b, c, d, e;
  cin >> a >> b >> c >> d >> e;
  
  int num = a * (b - c);
  
  vector<int> x(num + 1);
  x.at(1) = d;
  int ans = d;
  for (int i = 2; i <= num; i++) {
    if (i % 10 != 0) x.at(i) = x.at(i - 1);
    else {
      if (e <= x.at(i - 1)) x.at(i) = x.at(i - 1) - e;
      else x.at(i) = x.at(i - 1);
    }
    ans += x.at(i);
  }
  
  cout << ans << '\n';
}
0