提出 #50516543
ソースコード 拡げる
use proconio::input;
fn main() {
input! {
h: usize,
w: usize,
a: [[usize; w]; h],
};
let rows = a
.iter()
.map(|r| r.iter().sum::<usize>())
.collect::<Vec<usize>>();
let cols = (0..w)
.map(|j| (0..h).map(|i| a[i][j]).sum::<usize>())
.collect::<Vec<usize>>();
for i in 0..h {
for j in 0..w {
let ans = rows[i] + cols[j] - a[i][j];
print!("{}{}", ans, if j == w - 1 { "\n" } else { " " });
}
}
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | 004 - Cross Sum(★2) |
| ユーザ | bouzuya |
| 言語 | Rust (rustc 1.70.0) |
| 得点 | 2 |
| コード長 | 523 Byte |
| 結果 | AC |
| 実行時間 | 322 ms |
| メモリ | 71252 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 2 / 2 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt |
| All | hand01.txt, hand02.txt, hand03.txt, hand04.txt, random01.txt, random02.txt, random03.txt, random04.txt, random05.txt, random06.txt, random07.txt, random08.txt, sample_01.txt, sample_02.txt, sample_03.txt, sample_04.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| hand01.txt | AC | 1 ms | 2004 KiB |
| hand02.txt | AC | 3 ms | 2000 KiB |
| hand03.txt | AC | 1 ms | 2072 KiB |
| hand04.txt | AC | 322 ms | 71252 KiB |
| random01.txt | AC | 25 ms | 5932 KiB |
| random02.txt | AC | 104 ms | 24544 KiB |
| random03.txt | AC | 62 ms | 15344 KiB |
| random04.txt | AC | 82 ms | 19724 KiB |
| random05.txt | AC | 2 ms | 2192 KiB |
| random06.txt | AC | 17 ms | 4584 KiB |
| random07.txt | AC | 282 ms | 62748 KiB |
| random08.txt | AC | 56 ms | 12868 KiB |
| sample_01.txt | AC | 1 ms | 1912 KiB |
| sample_02.txt | AC | 1 ms | 1884 KiB |
| sample_03.txt | AC | 0 ms | 2000 KiB |
| sample_04.txt | AC | 0 ms | 1924 KiB |