| Task: | Hypyt |
| Sender: | Jaksu |
| Submission time: | 2025-10-30 14:00:21 +0200 |
| Language: | Rust (2021) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| #2 | WRONG ANSWER | 0 |
| #3 | WRONG ANSWER | 0 |
| #4 | WRONG ANSWER | 0 |
| #5 | WRONG ANSWER | 0 |
| test | verdict | time | group | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #2 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #3 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #4 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #5 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #6 | WRONG ANSWER | 0.00 s | 2, 5 | details |
| #7 | WRONG ANSWER | 0.00 s | 2, 5 | details |
| #8 | WRONG ANSWER | 0.00 s | 2, 5 | details |
| #9 | WRONG ANSWER | 0.32 s | 3, 4, 5 | details |
| #10 | WRONG ANSWER | 0.32 s | 3, 4, 5 | details |
| #11 | WRONG ANSWER | 0.33 s | 3, 4, 5 | details |
| #12 | WRONG ANSWER | 0.33 s | 4, 5 | details |
| #13 | WRONG ANSWER | 0.34 s | 4, 5 | details |
| #14 | WRONG ANSWER | 0.32 s | 4, 5 | details |
| #15 | WRONG ANSWER | 0.33 s | 5 | details |
| #16 | WRONG ANSWER | 0.33 s | 5 | details |
| #17 | WRONG ANSWER | 0.33 s | 5 | details |
| #18 | WRONG ANSWER | 0.33 s | 5 | details |
| #19 | WRONG ANSWER | 0.33 s | 5 | details |
| #20 | WRONG ANSWER | 0.33 s | 5 | details |
| #21 | WRONG ANSWER | 0.32 s | 5 | details |
| #22 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #23 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #24 | WRONG ANSWER | 0.32 s | 5 | details |
| #25 | WRONG ANSWER | 0.32 s | 5 | details |
| #26 | WRONG ANSWER | 0.33 s | 5 | details |
| #27 | WRONG ANSWER | 0.32 s | 5 | details |
Compiler report
warning: unused variable: `q`
--> input/code.rs:24:9
|
24 | for q in 0..startdata[2] {
| ^ help: if this is intentional, prefix it with an underscore: `_q`
|
= note: `#[warn(unused_variables)]` on by default
warning: variable does not need to be mutable
--> input/code.rs:49:29
|
49 | let mut newcoords = vec!(rownum, coords[1], coords[2], coords[3]);
| ----^^^^^^^^^
| |
| help: remove this `mut`
|
= note: `#[warn(unused_mut)]` on by default
warning: variable does not need to be mutable
--> input/code.rs:58:29
|
58 | let mut newcoords = vec!(coords[0], *freecell, coords[2], coords[3]);
| ----^^^^^^^^^
| |
| help: remove this `mut`
warning: 3 warnings emittedCode
use std::io;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read input");
let startdata: Vec<usize> = input.split_ascii_whitespace().map(|e| e.parse::<usize>().unwrap()).collect();
let mut grid:Vec<Vec<usize>> = vec!();
drop(input);
for row in 0..startdata[0] {
grid.push(Vec::new());
let mut rowinput = String::new();
io::stdin().read_line(&mut rowinput).expect("Failed to read input");
let bytes = rowinput.into_bytes();
for index in 0..startdata[1] {
if bytes[index] == 46 {
grid[row].push(index);
}
}
}
for q in 0..startdata[2] {
let mut qinput = String::new();
io::stdin().read_line(&mut qinput).expect("Failed to read input");
let coords: Vec<usize> = qinput.split_ascii_whitespace().map(|e| e.parse::<usize>().unwrap()-1).collect();
let mut rowmemory: Vec<usize> = vec!();
let mut colmemory: Vec<usize> = vec!();
let steps = min_step(&coords, &mut rowmemory, &mut colmemory, &grid);
println!("{}", steps)
}
}
pub fn min_step(coords: &Vec<usize>, rowmemory: &mut Vec<usize>, colmemory: &mut Vec<usize>, grid: &Vec<Vec<usize>>) -> isize {
let mut output = 0;
let mut stepvector = vec!();
let mut found_free_cell: bool = false;
if coords[3] == coords[1] || coords[2] == coords[0] {
output += 1;
} else {
for rownum in 0..grid.len() {
for freecell in grid[rownum].iter() {
if rownum != coords[0] && *freecell != coords[1] {
if rownum == coords[0] && !rowmemory.contains(&rownum) {
found_free_cell = true;
output += 1;
let mut newcoords = vec!(rownum, coords[1], coords[2], coords[3]);
let mut newrowmemory = rowmemory.clone();
newrowmemory.push(coords[0]);
let steps = min_step(&newcoords, &mut newrowmemory, colmemory, grid);
stepvector.push(steps);
}
if freecell == &coords[1] && !colmemory.contains(freecell) {
found_free_cell = true;
output += 1;
let mut newcoords = vec!(coords[0], *freecell, coords[2], coords[3]);
let mut newcolmemory = colmemory.clone();
newcolmemory.push(coords[1]);
let steps = min_step(&newcoords, rowmemory, &mut newcolmemory, grid);
stepvector.push(steps);
}
}
}
}
if !found_free_cell {
output = -1;
}
}
return output;
}Test details
Test 1 (public)
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 4 6 5 .*.*** *...** *****. *..*.* ... |
| correct output |
|---|
| 1 0 3 3 -1 |
| user output |
|---|
| 1 1 -1 -1 -1 |
Feedback: Incorrect character on line 2 col 1: expected "0", got "1"
Test 2
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 10 .......... .....*.... ........*. *.*....*.. ... |
| correct output |
|---|
| 1 2 1 2 2 ... |
| user output |
|---|
| 1 -1 1 -1 -1 ... |
Feedback: Incorrect character on line 2 col 1: expected "2", got "-1"
Test 3
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 10 *...***.** *****.*... **..**.**. ..**.**.*. ... |
| correct output |
|---|
| 1 2 2 1 2 ... |
| user output |
|---|
| 1 -1 -1 1 -1 ... |
Feedback: Incorrect character on line 2 col 1: expected "2", got "-1"
Test 4
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 10 ***.*.**** ********** *.******** .*.***.**. ... |
| correct output |
|---|
| 3 4 2 3 4 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "3", got "-1"
Test 5
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 1 .****.**** **.**..*** ********** *******..* ... |
| correct output |
|---|
| 7 |
| user output |
|---|
| -1 |
Feedback: Incorrect character on line 1 col 1: expected "7", got "-1"
Test 6
Group: 2, 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 250 .*...*.....*******..**...*....... |
| correct output |
|---|
| 2 3 3 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 7
Group: 2, 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 250 ...*......**.**.*.*..**..*..**... |
| correct output |
|---|
| 2 2 2 2 3 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 8
Group: 2, 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 250 **..**..****.****.*.***.***..*... |
| correct output |
|---|
| 2 3 3 3 3 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 9
Group: 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 40 40 200000 ...*.**.*..*.............*.*..... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 10
Group: 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 40 40 200000 **.**..*.*.*.******....****.*.... |
| correct output |
|---|
| 2 1 3 2 2 ... |
| user output |
|---|
| -1 1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 11
Group: 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 40 40 200000 .*.*.**.*****.***.*.****.**.**... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "3", got "-1"
Test 12
Group: 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 80 80 200000 *....**.***..****...*.....*...... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 13
Group: 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 80 80 200000 .***.*..*.***..*****....**...*... |
| correct output |
|---|
| 3 2 2 3 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "3", got "-1"
Test 14
Group: 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 80 80 200000 *******.*****.*..*..****...***... |
| correct output |
|---|
| 2 3 1 2 2 ... |
| user output |
|---|
| -1 -1 1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 15
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 *....*..*..*..**..*.........**... |
| correct output |
|---|
| 3 2 2 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "3", got "-1"
Test 16
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ..*....*..*......*.**.*.*..***... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 17
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 *..*.*****.*********.****.****... |
| correct output |
|---|
| 3 3 2 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "3", got "-1"
Test 18
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 *********.**********.******.**... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "3", got "-1"
Test 19
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 .*****************************... |
| correct output |
|---|
| 104 422 145 93 65 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "104", got "-1"
Test 20
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ..****************************... |
| correct output |
|---|
| 57 155 38 65 98 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "57", got "-1"
Test 21
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 .*****************************... |
| correct output |
|---|
| 498 498 498 498 498 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "498", got "-1"
Test 22
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 1 10 * * . * ... |
| correct output |
|---|
| 0 1 1 0 0 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 1 col 1: expected "0", got "1"
Test 23
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 1 10 10 ........*. 1 7 1 10 1 4 1 7 1 5 1 1 ... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 7 col 1: expected "0", got "1"
Test 24
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 1 200000 * . * . ... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 53 col 1: expected "0", got "1"
Test 25
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 1 250 200000 *.*.*...*.*.**.***..**.*.*..**... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 283 col 1: expected "0", got "1"
Test 26
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ................................. |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| -1 -1 -1 -1 -1 ... |
Feedback: Incorrect character on line 1 col 1: expected "2", got "-1"
Test 27
Group: 5
Verdict: WRONG ANSWER
| input |
|---|
| 250 250 200000 ******************************... |
| correct output |
|---|
| 0 0 0 0 0 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Feedback: Incorrect character on line 1 col 1: expected "0", got "1"
