提出 #36070061
ソースコード 拡げる
use proconio::input;
use proconio::marker::Chars;
fn main() {
input! {
board: [Chars; 9],
}
let mut result = 0;
for i in 0..9 {
for j in 0..9 {
if board[i][j] == '#' {
for next_i in i..9 {
'zoe: for next_j in (j + 1)..9 {
if board[next_i][next_j] != '#' {
continue 'zoe;
}
let i_diff = next_i - i;
let j_diff = next_j - j;
if next_i + j_diff >= 9 || j < i_diff {
continue 'zoe;
}
if board[i + j_diff][j - i_diff] == '#' && board[next_i + j_diff][next_j - i_diff] == '#' {
result += 1;
}
}
}
}
}
}
println!("{}", result);
}
提出情報
| 提出日時 | |
|---|---|
| 問題 | C - Counting Squares |
| ユーザ | Bookends |
| 言語 | Rust (1.42.0) |
| 得点 | 300 |
| コード長 | 1009 Byte |
| 結果 | AC |
| 実行時間 | 7 ms |
| メモリ | 2192 KiB |
ジャッジ結果
| セット名 | Sample | All | ||||
|---|---|---|---|---|---|---|
| 得点 / 配点 | 0 / 0 | 300 / 300 | ||||
| 結果 |
|
|
| セット名 | テストケース |
|---|---|
| Sample | 00_sample_01.txt, 00_sample_02.txt |
| All | 00_sample_01.txt, 00_sample_02.txt, 01_test_01.txt, 01_test_02.txt, 01_test_03.txt, 01_test_04.txt, 01_test_05.txt, 01_test_06.txt, 01_test_07.txt, 01_test_08.txt, 01_test_09.txt, 01_test_10.txt, 01_test_11.txt, 01_test_12.txt, 01_test_13.txt |
| ケース名 | 結果 | 実行時間 | メモリ |
|---|---|---|---|
| 00_sample_01.txt | AC | 7 ms | 2088 KiB |
| 00_sample_02.txt | AC | 2 ms | 2072 KiB |
| 01_test_01.txt | AC | 2 ms | 2060 KiB |
| 01_test_02.txt | AC | 2 ms | 2052 KiB |
| 01_test_03.txt | AC | 2 ms | 2052 KiB |
| 01_test_04.txt | AC | 2 ms | 1992 KiB |
| 01_test_05.txt | AC | 1 ms | 2132 KiB |
| 01_test_06.txt | AC | 2 ms | 2172 KiB |
| 01_test_07.txt | AC | 2 ms | 1984 KiB |
| 01_test_08.txt | AC | 2 ms | 2136 KiB |
| 01_test_09.txt | AC | 2 ms | 2192 KiB |
| 01_test_10.txt | AC | 2 ms | 2052 KiB |
| 01_test_11.txt | AC | 2 ms | 2132 KiB |
| 01_test_12.txt | AC | 2 ms | 2108 KiB |
| 01_test_13.txt | AC | 2 ms | 2132 KiB |