結果
問題 | No.987 N×Mマス計算(基本) |
ユーザー | knohkw |
提出日時 | 2022-04-27 11:55:38 |
言語 | Rust (1.77.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 947 bytes |
コンパイル時間 | 20,859 ms |
コンパイル使用メモリ | 379,068 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-28 07:44:06 |
合計ジャッジ時間 | 14,493 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge3 |
(要ログイン)
テストケース
テストケース表示入力 | 結果 | 実行時間 実行使用メモリ |
---|---|---|
testcase_00 | AC | 1 ms
5,248 KB |
testcase_01 | WA | - |
testcase_02 | WA | - |
testcase_03 | WA | - |
testcase_04 | WA | - |
testcase_05 | WA | - |
testcase_06 | AC | 1 ms
5,376 KB |
testcase_07 | AC | 1 ms
5,376 KB |
testcase_08 | AC | 1 ms
5,376 KB |
testcase_09 | AC | 1 ms
5,376 KB |
testcase_10 | WA | - |
testcase_11 | AC | 2 ms
5,376 KB |
testcase_12 | WA | - |
testcase_13 | WA | - |
testcase_14 | AC | 1 ms
5,376 KB |
testcase_15 | AC | 1 ms
5,376 KB |
testcase_16 | AC | 2 ms
5,376 KB |
testcase_17 | WA | - |
testcase_18 | AC | 2 ms
5,376 KB |
testcase_19 | WA | - |
コンパイルメッセージ
warning: unreachable pattern --> src/main.rs:28:9 | 18 | plus => { | ---- matches any value ... 28 | _ => { | ^ unreachable pattern | = note: `#[warn(unreachable_patterns)]` on by default warning: unused variable: `plus` --> src/main.rs:16:9 | 16 | let plus = String::from("+"); | ^^^^ help: if this is intentional, prefix it with an underscore: `_plus` | = note: `#[warn(unused_variables)]` on by default warning: unused variable: `plus` --> src/main.rs:18:9 | 18 | plus => { | ^^^^ help: if this is intentional, prefix it with an underscore: `_plus` warning: variable `N` should have a snake case name --> src/main.rs:5:9 | 5 | N: usize, | ^ help: convert the identifier to snake case: `n` | = note: `#[warn(non_snake_case)]` on by default warning: variable `M` should have a snake case name --> src/main.rs:6:9 | 6 | M: usize, | ^ help: convert the identifier to snake case: `m` warning: variable `A` should have a snake case name --> src/main.rs:8:9 | 8 | A: [i64; N], | ^ help: convert the identifier to snake case: `a` warning: variable `B` should have a snake case name --> src/main.rs:12:9 | 12 | let B: Vec<i64> = header.into_iter() | ^ help: convert the identifier to snake case: `b`
ソースコード
use proconio::input; fn main() { input! { N: usize, M: usize, mut header: [String; M + 1], A: [i64; N], } let op = header.remove(0); let B: Vec<i64> = header.into_iter() .map(|s| s.parse().unwrap()) .collect(); let plus = String::from("+"); match op { plus => { for i in 0..N { let a = A[i]; let row: Vec<String> = B.iter() .map(|b| (a + b).to_string()) .collect(); let row = row.join(" "); println!("{}", row) } }, _ => { for i in 0..N { let a = A[i]; let row: Vec<String> = B.iter() .map(|b| (a * b).to_string()) .collect(); let row = row.join(" "); println!("{}", row) } } } }