結果
| 問題 | No.987 N×Mマス計算(基本) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-18 13:25:07 |
| 言語 | Rust (1.92.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 2 ms / 2,000 ms |
| コード長 | 862 bytes |
| 記録 | |
| コンパイル時間 | 29,072 ms |
| コンパイル使用メモリ | 417,088 KB |
| 実行使用メモリ | 7,848 KB |
| 最終ジャッジ日時 | 2026-01-18 13:26:09 |
| 合計ジャッジ時間 | 27,006 ms |
|
ジャッジサーバーID (参考情報) |
judge2 / judge4 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
ソースコード
use proconio::{fastout, input};
#[fastout]
fn main() {
input! {
n: usize,
m: usize,
op: char,
b: [u32; m],
a: [u32; n],
}
println!("{}", output(solve(op, b, a)))
}
fn solve(op: char, b: Vec<u32>, a: Vec<u32>) -> Vec<Vec<u64>> {
a.into_iter()
.map(|a| {
b.iter()
.map(|&b| match op {
'+' => (a + b) as u64,
'*' => a as u64 * b as u64,
_ => unreachable!(),
})
.collect()
})
.collect()
}
fn output(ans: Vec<Vec<u64>>) -> String {
ans.into_iter()
.map(|x| {
x.into_iter()
.map(|x| x.to_string())
.collect::<Vec<_>>()
.join(" ")
})
.collect::<Vec<_>>()
.join("\n")
}