結果

問題 No.3433 [Cherry 8th Tune A] ADD OIL!
コンテスト
ユーザー moshi777
提出日時 2026-01-23 21:36:37
言語 C++17(gnu拡張)
(gcc 15.2.0 + boost 1.89.0)
結果
AC  
実行時間 3 ms / 2,000 ms
コード長 1,669 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 4,413 ms
コンパイル使用メモリ 203,924 KB
実行使用メモリ 7,848 KB
最終ジャッジ日時 2026-01-23 21:36:42
合計ジャッジ時間 4,854 ms
ジャッジサーバーID
(参考情報)
judge1 / judge2
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 12
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#include <algorithm>
#include <atcoder/all>
#include <bit>
#include <cassert>
#include <cmath>
#include <deque>
#include <iostream>
#include <limits>
#include <map>
#include <numeric>
#include <queue>
#include <set>
#include <stack>
#include <string>
#include <tuple>
#include <unordered_map>
#include <unordered_set>
#include <utility>
#include <vector>
using namespace atcoder;

using namespace std;

#define rep(i, n) for (int i = 0; i < (int)(n); ++i)
#define rep1(i, n) for (int i = 1; i <= (int)(n); ++i)
#define repr(i, n) for (int i = (int)(n) - 1; i >= 0; --i)
#define rep3(i, l, r) for (int i = (int)(l); i < (int)(r); ++i)
#define repr3(i, l, r) for (int i = (int)(r) - 1; i >= (int)(l); --i)

using ll = long long;
using ull = unsigned long long;
using P = pair<int, int>;
using Pll = pair<ll, ll>;
using vi = vector<int>;
using vvi = vector<vector<int>>;
using vvvi = vector<vector<vector<int>>>;
using vP = vector<P>;
using vPll = vector<Pll>;
using vvP = vector<vector<P>>;
using vll = vector<ll>;
using vvll = vector<vector<ll>>;
using vs = vector<string>;
using vvs = vector<vs>;
using vb = vector<bool>;
using vvb = vector<vb>;

#define all(x) (x).begin(), (x).end()
#define fi first
#define se second

template <class T>
void chmax(T& a, const T& b) {
    if (a < b) a = b;
}
template <class T>
void chmin(T& a, const T& b) {
    if (a > b) a = b;
}
int T;
int N, K;
vll A;
int main() {
    cin >> T;
    rep(ti, T) {
        cin >> N >> K;
        A.assign(N, 0);
        rep(i, N) cin >> A[i];

        sort(all(A));

        A[0] -= K;

        ll ans = accumulate(all(A), 1LL, multiplies<ll>());
        cout << ans << endl;
    }
    return 0;
}
0