結果

問題 No.1453 手助け
ユーザー kekenxkekenx
提出日時 2024-01-09 12:16:09
言語 C++17
(gcc 12.3.0 + boost 1.83.0)
結果
WA  
実行時間 -
コード長 502 bytes
コンパイル時間 684 ms
コンパイル使用メモリ 68,536 KB
実行使用メモリ 6,676 KB
最終ジャッジ日時 2024-01-09 12:16:11
合計ジャッジ時間 1,962 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 2 ms
6,676 KB
testcase_01 AC 2 ms
6,676 KB
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 AC 2 ms
6,676 KB
testcase_06 WA -
testcase_07 AC 2 ms
6,676 KB
testcase_08 AC 4 ms
6,676 KB
testcase_09 AC 2 ms
6,676 KB
testcase_10 WA -
testcase_11 AC 2 ms
6,676 KB
testcase_12 WA -
testcase_13 AC 2 ms
6,676 KB
testcase_14 WA -
testcase_15 WA -
testcase_16 AC 2 ms
6,676 KB
testcase_17 AC 4 ms
6,676 KB
testcase_18 WA -
testcase_19 AC 3 ms
6,676 KB
testcase_20 WA -
testcase_21 WA -
testcase_22 AC 2 ms
6,676 KB
testcase_23 AC 1 ms
6,676 KB
権限があれば一括ダウンロードができます

ソースコード

diff #

#include <iostream>
#include <cassert>

using namespace std;

int main() {
  ios::sync_with_stdio(false);
  cin.tie(nullptr);

  int a, b, c, d, e; cin >> a >> b >> c >> d >> e;
  int x = b - c;
  if (x <= 0) {
    cout << 0 << endl;
    return 0;
  }

  int cur = d;
  int ans = 0;
  for (int i = 1; i <= x * a; i++) {
    if (cur % 10 != 0) {
      ans += cur;
    } else if (e <= cur) {
      cur -= e;
      ans += cur;
    } else {
      ans += cur;
    }
  }
  cout << ans << endl;
  return 0;
}
0