結果
| 問題 | No.987 N×Mマス計算(基本) |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-18 13:25:07 |
| 言語 | Rust (1.94.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| + 542µs | |
| コード長 | 862 bytes |
| 記録 | |
| コンパイル時間 | 881 ms |
| コンパイル使用メモリ | 193,972 KB |
| 実行使用メモリ | 5,888 KB |
| 最終ジャッジ日時 | 2026-07-20 11:49:16 |
| 合計ジャッジ時間 | 3,011 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_1 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| 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")
}