結果
| 問題 | No.3433 [Cherry 8th Tune A] ADD OIL! |
| コンテスト | |
| ユーザー |
vjudge1
|
| 提出日時 | 2026-02-09 01:35:17 |
| 言語 | C++17 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 3,166 bytes |
| 記録 | |
| コンパイル時間 | 2,318 ms |
| コンパイル使用メモリ | 225,384 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-02-09 01:35:21 |
| 合計ジャッジ時間 | 3,451 ms |
|
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#include <bits/stdc++.h>
using namespace std;
using ll = long long;
using vi = vector<int>;
using vb = vector<bool>;
using vc = vector<char>;
using vs = vector<string>;
using vll = vector<ll>;
#define int long long
#define f first
#define s second
#define pb push_back
#define all(x) (x).begin(), (x).end()
#define rall(x) (x).rbegin(), (x).rend()
#define foo(i,a,b) for (int i = (a); i < (b); ++i)
#define rfoo(i,a,b) for (int i = (a); i >= (b); --i)
#define input(v) for (auto &x : v) cin >> x
#define print(v) for (auto x : v) cout << x << " "; cout << '\n'
#define yes cout << "YES" << std::endl;
#define no cout << "NO" << std::endl;
#define nl cout << "\n";
const int MOD = 1e9 + 7;
const ll INF = 1e18;
ll gcd(ll a, ll b) { return b ? gcd(b, a % b) : a; }
ll power(ll a, ll b) {
ll res = 1;
while (b) {
if (b & 1) res *= a;
a *= a;
b >>= 1;
}
return res;
}
ll modexp(ll a, ll b, ll mod = MOD) {
ll res = 1;
a %= mod;
while (b) {
if (b & 1) res = (res * a) % mod;
a = (a * a) % mod;
b >>= 1;
}
return res;
}
ll modmul(ll a, ll b, ll mod = MOD) {
return ((a % mod) * (b % mod)) % mod;
}
bool isprime(int n) {
if (n < 2) return false;
for (int i = 2; i * i <= n; ++i)
if (n % i == 0) return false;
return true;
}
void sieve(int n, vector<bool> &isPrime) {
isPrime.assign(n + 1, true);
isPrime[0] = isPrime[1] = false;
for (int i = 2; i * i <= n; ++i)
if (isPrime[i])
for (int j = i * i; j <= n; j += i)
isPrime[j] = false;
}
int getbit(ll n, int b) { return (n >> b) & 1; }
ll setbit(ll n, int b) { return n | (1LL << b); }
ll resetbit(ll n, int b) { return n & ~(1LL << b); }
ll togglebit(ll n, int b) { return n ^ (1LL << b); }
bool ispoftwo(ll n) { return n > 0 && !(n & (n - 1)); }
int countSetBits(ll n) { return __builtin_popcountll(n); }
int digitCount(ll n, int base = 10) {
return n ? (int)(log(n) / log(base)) + 1 : 1;
}
vi factors(int n) {
vi res;
for (int i = 1; i * i <= n; i++) {
if (n % i == 0) {
res.pb(i);
if (i != n / i) res.pb(n / i);
}
}
sort(all(res));
return res;
}
#define lb(v, x) (lower_bound(all(v), x) - (v).begin())
#define ub(v, x) (upper_bound(all(v), x) - (v).begin())
#define count_occ(v, x) (ub(v, x) - lb(v, x))
#define fastio ios::sync_with_stdio(false); cin.tie(nullptr); cout.tie(nullptr)
signed main() {
fastio;
int t = 1;
cin >> t;
while (t--)
{
int n,k; cin>>n>>k;
vi v(n); input(v);
int mini = INT_MAX;
sort(all(v));
v[0] -= k;
int p = 1;
foo(i,0,n) {
p = p*v[i];
}
cout << p;
// foo(i,0,n) {
// int p = 1;
// foo(j,0,n) {
// if (i == j) {
// p = p * (v[j]-k);
// }
// else {
// p = p * v[j];
// }
// }
// mini = min(p,mini);
// }
// cout<<mini;
nl
}
}
vjudge1