結果
| 問題 | No.3433 [Cherry 8th Tune A] ADD OIL! |
| コンテスト | |
| ユーザー |
SnowBeenDiding
|
| 提出日時 | 2026-01-23 21:22:54 |
| 言語 | C++23 (gcc 15.2.0 + boost 1.89.0) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 681 bytes |
| 記録 | |
| コンパイル時間 | 9,868 ms |
| コンパイル使用メモリ | 420,860 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-23 21:23:20 |
| 合計ジャッジ時間 | 10,619 ms |
|
ジャッジサーバーID (参考情報) |
judge1 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#pragma GCC target("avx2")
#pragma GCC optimize("O3")
#pragma GCC optimize("unroll-loops")
#include <bits/stdc++.h>
#include <atcoder/all>
#define rep(i, a, b) for (ll i = (ll)(a); i < (ll)(b); i++)
using namespace atcoder;
using namespace std;
typedef long long ll;
void solve() {
int n, k;
cin >> n >> k;
vector<int> a(n);
rep(i, 0, n) cin >> a[i];
ll sm = 1;
rep(i, 0, n) sm *= a[i];
ll ans = 1e18;
rep(i, 0, n) { ans = min(ans, sm / a[i] * (a[i] - k)); }
cout << ans << '\n';
}
int main() {
ios::sync_with_stdio(false);
cin.tie(nullptr);
cout << fixed << setprecision(15);
int t;
cin >> t;
while (t--) solve();
}
SnowBeenDiding