結果

問題 No.2138 Add Bacon
ユーザー ygd.ygd.
提出日時 2022-12-01 22:29:57
言語 C++23(draft)
(gcc 13.2.0 + boost 1.83.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,134 bytes
コンパイル時間 11,259 ms
コンパイル使用メモリ 486,324 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-04-17 09:58:25
合計ジャッジ時間 12,160 ms
ジャッジサーバーID
(参考情報)
judge3 / judge1
このコードへのチャレンジ(β)

テストケース

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

ソースコード

diff #

#include <bits/stdc++.h>
#include<atcoder/all>
#include<boost/multiprecision/cpp_int.hpp> //多倍長
using namespace boost::multiprecision; // 多倍長.型はcpp_int
using namespace atcoder;
using namespace std;
//
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
//
#define rep(i, n) for (int i = 0; i < (int)(n); i++)
#define ALL(a) (a).begin(),(a).end() //lower_bound(ALL(a),x)
using ll = long long;
using P = pair<int,int>;
using VI = vector<int>;
using VVI = vector<vector<int>>;

int MOD = 998244353;
int INF = 100100100;

const vector<int> dx = {1, 0, -1, 0};
const vector<int> dy = {0, 1, 0, -1};

// int depth[110000];
// int mxdepth[110000];

long long modpow(long long a, long long n, long long mod) {
    long long res = 1;
    // a = 0の時は1を出力
  	if (a == 0) return 1;
    while (n > 0) {
        if (n & 1) res = res * a % mod;
        a = a * a % mod;
        n >>= 1;
    }
    return res;
}

int main() {
    int a,b,c,d,e;
    cin >> a >> b >> c >> d >> e;
    int ans = a - b;
    if (d - e > 0) {
        ans += (d - e) * c;
    }
    cout << ans << endl;
}

0