結果
| 問題 | No.3433 [Cherry 8th Tune A] ADD OIL! |
| コンテスト | |
| ユーザー |
norioc
|
| 提出日時 | 2026-07-01 01:29:44 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 964 bytes |
| 記録 | |
| コンパイル時間 | 4,628 ms |
| コンパイル使用メモリ | 197,716 KB |
| 実行使用メモリ | 6,528 KB |
| 最終ジャッジ日時 | 2026-07-01 01:29:51 |
| 合計ジャッジ時間 | 1,887 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | AC * 12 |
ソースコード
#![allow(non_snake_case, unused_imports)]
use proconio::{input, marker::Usize1, marker::Chars};
use itertools::Itertools;
#[allow(unused_macros)]
macro_rules! d {
( $( $x:expr ),* $(,)? ) => {
eprintln!(
concat!( $( stringify!($x), "={:?} " ),* ),
$( $x ),*
);
};
}
#[allow(dead_code)]
fn yn(b: bool) -> &'static str {
if b { "Yes" } else { "No" }
}
fn main() {
input! {
T: usize,
}
for _ in 0..T {
input! {
N: usize,
K: i64,
A: [i64; N],
}
let slis = A.into_iter().sorted().collect_vec();
let ans = match slis.as_slice() {
[head, rest@..] => {
rest.iter()
.copied()
.chain(std::iter::once(head - K))
.reduce(|a, b| a * b).unwrap()
},
&[] => unreachable!()
};
println!("{}", ans);
}
}
norioc