| Task: | Hypyt |
| Sender: | Jaksu |
| Submission time: | 2025-11-05 13:59:39 +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 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #2 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
| #3 | ACCEPTED | 0.01 s | 1, 2, 3, 4, 5 | details |
| #4 | WRONG ANSWER | 0.00 s | 1, 2, 3, 4, 5 | details |
| #5 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #6 | TIME LIMIT EXCEEDED | -- | 2, 5 | details |
| #7 | TIME LIMIT EXCEEDED | -- | 2, 5 | details |
| #8 | TIME LIMIT EXCEEDED | -- | 2, 5 | details |
| #9 | TIME LIMIT EXCEEDED | -- | 3, 4, 5 | details |
| #10 | TIME LIMIT EXCEEDED | -- | 3, 4, 5 | details |
| #11 | TIME LIMIT EXCEEDED | -- | 3, 4, 5 | details |
| #12 | TIME LIMIT EXCEEDED | -- | 4, 5 | details |
| #13 | TIME LIMIT EXCEEDED | -- | 4, 5 | details |
| #14 | TIME LIMIT EXCEEDED | -- | 4, 5 | details |
| #15 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #16 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #17 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #18 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #19 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #20 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #21 | ACCEPTED | 0.34 s | 5 | details |
| #22 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #23 | ACCEPTED | 0.00 s | 1, 2, 3, 4, 5 | details |
| #24 | ACCEPTED | 0.51 s | 5 | details |
| #25 | ACCEPTED | 0.53 s | 5 | details |
| #26 | TIME LIMIT EXCEEDED | -- | 5 | details |
| #27 | ACCEPTED | 0.33 s | 5 | details |
Compiler report
warning: unused import: `HashSet`
--> input/code.rs:2:33
|
2 | use std::collections::{HashMap, HashSet, VecDeque};
| ^^^^^^^
|
= note: `#[warn(unused_imports)]` on by default
warning: unused imports: `SystemTime`, `UNIX_EPOCH`
--> input/code.rs:4:17
|
4 | use std::time::{SystemTime, UNIX_EPOCH};
| ^^^^^^^^^^ ^^^^^^^^^^
warning: 2 warnings emittedCode
use std::io;
use std::collections::{HashMap, HashSet, VecDeque};
//use rand::{random, random_bool, random_range};
use std::time::{SystemTime, UNIX_EPOCH};
type NodeID = (usize, usize);
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input).expect("Failed to read input");
let startdata: Vec<usize> = input.split_whitespace().map(|e| e.parse::<usize>().unwrap()).collect();
let mut rowgrid: Vec<Vec<NodeID>> = vec!();
let mut colgrid: Vec<Vec<NodeID>> = vec!();
for row in 0..startdata[0] {
rowgrid.push(Vec::new());
let mut rowinput = String::new();
io::stdin().read_line(&mut rowinput).expect("Failed to read input");
let bytes = rowinput.as_bytes();
for c in 0..startdata[1] {
if row == 0 {
colgrid.push(Vec::new());
}
if bytes[c] == 46 {
rowgrid[row].push((row, c));
colgrid[c].push((row, c));
}
}
}
let mut distancehash: HashMap<(NodeID, NodeID), usize> = HashMap::new();
for _ in 0..startdata[2] {
let mut questioninput = String::new();
io::stdin().read_line(&mut questioninput).expect("Failed to read input");
let questiondata: Vec<usize> = questioninput.split_whitespace().map(|e| e.parse::<usize>().unwrap()-1).collect();
let source = (questiondata[0], questiondata[1]);
let dest = (questiondata[2], questiondata[3]);
match distancehash.get(&(source, dest)) {
Some(dist) => {
println!("{}", dist);
continue;
}
None => {}
}
let mut queue: VecDeque<NodeID> = VecDeque::new();
queue.push_front(source);
distancehash.insert((source, source), 0);
while queue.len() != 0 {
let node = queue.pop_back().unwrap();
let dist = distancehash[&(source, node)];
dbg!(&node);
for neighbor in rowgrid[node.0].iter() {
if *neighbor != node {
match distancehash.get(&(source, *neighbor)) {
Some(_) => {}
None => {
distancehash.insert((source, *neighbor), dist+1);
distancehash.insert((*neighbor, source), dist+1);
queue.push_front(*neighbor);
}
}
}
}
for neighbor in colgrid[node.1].iter() {
if *neighbor != node {
match distancehash.get(&(source, *neighbor)) {
Some(_) => {}
None => {
distancehash.insert((source, *neighbor), dist+1);
distancehash.insert((*neighbor, source), dist+1);
queue.push_front(*neighbor);
}
}
}
}
}
match distancehash.get(&(source, dest)) {
Some(dist) => {println!("{}", dist);},
None => {println!("-1");}
}
}
}Test details
Test 1 (public)
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 4 6 5 .*.*** *...** *****. *..*.* ... |
| correct output |
|---|
| 1 0 3 3 -1 |
| user output |
|---|
| 1 0 3 3 -1 |
Error:
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
1,
2,
)
[input/code.rs:59] &node = (
3,
2,
)
[input/code.rs:59] &node = (
1,
1,
)
[input/code.rs:59] &node = (
1,
3,
)
[input/code.rs:59] &node = (
3,
1,
)
[input/code.rs:59] &node = (
3,
4,
)
[input/code.rs:59] &node = (
1,
1,
)
[input/code.rs:59] &node = (
1,
2,
)
[input/code.rs:59] &node = (
1,
3,
)
[input/code.rs:59] &node = (
3,
1,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
3,
2,
)
[input/code.rs:59] &node = (
3,
4,
)
[input/code.rs:59] &node = (
3,
4,
)
[input/code.rs:59] &node = (
3,
1,
)
[input/code.rs:59] &node = (
3,
2,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
1,
2,
)
[input/code.rs:59] &node = (
1,
3,
)
[input/code.rs:59] &node = (
2,
5,
)Test 2
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 10 .......... .....*.... ........*. *.*....*.. ... |
| correct output |
|---|
| 1 2 1 2 2 ... |
| user output |
|---|
| 1 2 1 2 2 ... |
Error:
[input/code.rs:59] &node = (
5,
3,
)
[input/code.rs:59] &node = (
5,
0,
)
[input/code.rs:59] &node = (
5,
1,
)
[input/code.rs:59] &node = (
5,
4,
)
[input/code.rs:59] &node = (
5,
5,
)
[input/code.rs:59] &node = (
5,
6,
)
[input/code.rs:59] &node = (
5,
8,
)
[input/code.rs:59] &node = (
5,
9,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
1,
3,
)
[input/code.rs:59] &node = (
2,
3,
)
[input/code.rs:59] &node = (
3,
3,
)
[input/code.rs:59] &node = (
4,
3,
)
[input/code.rs:59] &node = (
6,
3,
)
[input/code.rs:59] &node = (
8,
3,
)
[input/code.rs:59] &node = (
9,
3,
)
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
1,
0,
)
[input/code.rs:59] &node = (
2,
0,
)
[input/code.rs:59] &node = (
4,
0,
)
[input/code.rs:59] &node = (
6,
0,
)
[input/code.rs:59] &node = (
7,
0,
)
[input/cod...Test 3
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 10 *...***.** *****.*... **..**.**. ..**.**.*. ... |
| correct output |
|---|
| 1 2 2 1 2 ... |
| user output |
|---|
| 1 2 2 1 2 ... |
Error:
[input/code.rs:59] &node = (
0,
1,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
0,
7,
)
[input/code.rs:59] &node = (
3,
1,
)
[input/code.rs:59] &node = (
4,
1,
)
[input/code.rs:59] &node = (
5,
1,
)
[input/code.rs:59] &node = (
6,
1,
)
[input/code.rs:59] &node = (
8,
1,
)
[input/code.rs:59] &node = (
2,
2,
)
[input/code.rs:59] &node = (
4,
2,
)
[input/code.rs:59] &node = (
7,
2,
)
[input/code.rs:59] &node = (
8,
2,
)
[input/code.rs:59] &node = (
9,
2,
)
[input/code.rs:59] &node = (
2,
3,
)
[input/code.rs:59] &node = (
4,
3,
)
[input/code.rs:59] &node = (
5,
3,
)
[input/code.rs:59] &node = (
6,
3,
)
[input/code.rs:59] &node = (
7,
3,
)
[input/code.rs:59] &node = (
1,
7,
)
[input/code.rs:59] &node = (
3,
7,
)
[input/code.rs:59] &node = (
4,
7,
)
[input/cod...Test 4
Group: 1, 2, 3, 4, 5
Verdict: WRONG ANSWER
| input |
|---|
| 10 10 10 ***.*.**** ********** *.******** .*.***.**. ... |
| correct output |
|---|
| 3 4 2 3 4 ... |
| user output |
|---|
| 3 4 2 3 4 ... |
Feedback: Incorrect character on line 6 col 1: expected "2", got "-1"
Error:
[input/code.rs:59] &node = (
7,
3,
)
[input/code.rs:59] &node = (
7,
2,
)
[input/code.rs:59] &node = (
7,
9,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
3,
2,
)
[input/code.rs:59] &node = (
3,
9,
)
[input/code.rs:59] &node = (
9,
9,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
3,
0,
)
[input/code.rs:59] &node = (
3,
6,
)
[input/code.rs:59] &node = (
9,
1,
)
[input/code.rs:59] &node = (
9,
4,
)
[input/code.rs:59] &node = (
9,
8,
)
[input/code.rs:59] &node = (
5,
5,
)
[input/code.rs:59] &node = (
8,
5,
)
[input/code.rs:59] &node = (
8,
0,
)
[input/code.rs:59] &node = (
2,
1,
)
[input/code.rs:59] &node = (
8,
4,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
5,
5,
)
[input/code.rs:59] &node = (
8,
5,
)
[input/cod...Test 5
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 10 1 .****.**** **.**..*** ********** *******..* ... |
| correct output |
|---|
| 7 |
| user output |
|---|
| 7 |
Error:
[input/code.rs:59] &node = (
1,
2,
)
[input/code.rs:59] &node = (
1,
5,
)
[input/code.rs:59] &node = (
1,
6,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
8,
5,
)
[input/code.rs:59] &node = (
9,
6,
)
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
9,
3,
)
[input/code.rs:59] &node = (
5,
0,
)
[input/code.rs:59] &node = (
5,
7,
)
[input/code.rs:59] &node = (
3,
7,
)
[input/code.rs:59] &node = (
6,
7,
)
[input/code.rs:59] &node = (
3,
8,
)
[input/code.rs:59] &node = (
6,
4,
)Test 6
Group: 2, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 250 .*...*.....*******..**...*....... |
| correct output |
|---|
| 2 3 3 2 2 ... |
| user output |
|---|
| (empty) |
Test 7
Group: 2, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 250 ...*......**.**.*.*..**..*..**... |
| correct output |
|---|
| 2 2 2 2 3 ... |
| user output |
|---|
| (empty) |
Test 8
Group: 2, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 250 **..**..****.****.*.***.***..*... |
| correct output |
|---|
| 2 3 3 3 3 ... |
| user output |
|---|
| (empty) |
Test 9
Group: 3, 4, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 40 40 200000 ...*.**.*..*.............*.*..... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| (empty) |
Test 10
Group: 3, 4, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 40 40 200000 **.**..*.*.*.******....****.*.... |
| correct output |
|---|
| 2 1 3 2 2 ... |
| user output |
|---|
| (empty) |
Test 11
Group: 3, 4, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 40 40 200000 .*.*.**.*****.***.*.****.**.**... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| (empty) |
Test 12
Group: 4, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 80 80 200000 *....**.***..****...*.....*...... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| (empty) |
Test 13
Group: 4, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 80 80 200000 .***.*..*.***..*****....**...*... |
| correct output |
|---|
| 3 2 2 3 2 ... |
| user output |
|---|
| (empty) |
Test 14
Group: 4, 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 80 80 200000 *******.*****.*..*..****...***... |
| correct output |
|---|
| 2 3 1 2 2 ... |
| user output |
|---|
| (empty) |
Test 15
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 *....*..*..*..**..*.........**... |
| correct output |
|---|
| 3 2 2 2 2 ... |
| user output |
|---|
| (empty) |
Test 16
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 ..*....*..*......*.**.*.*..***... |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| (empty) |
Test 17
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 *..*.*****.*********.****.****... |
| correct output |
|---|
| 3 3 2 2 2 ... |
| user output |
|---|
| (empty) |
Test 18
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 *********.**********.******.**... |
| correct output |
|---|
| 3 3 3 3 3 ... |
| user output |
|---|
| (empty) |
Test 19
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 .*****************************... |
| correct output |
|---|
| 104 422 145 93 65 ... |
| user output |
|---|
| (empty) |
Test 20
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 ..****************************... |
| correct output |
|---|
| 57 155 38 65 98 ... |
| user output |
|---|
| (empty) |
Test 21
Group: 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 200000 .*****************************... |
| correct output |
|---|
| 498 498 498 498 498 ... |
| user output |
|---|
| 498 498 498 498 498 ... |
Error:
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
1,
0,
)
[input/code.rs:59] &node = (
1,
1,
)
[input/code.rs:59] &node = (
2,
1,
)
[input/code.rs:59] &node = (
2,
2,
)
[input/code.rs:59] &node = (
3,
2,
)
[input/code.rs:59] &node = (
3,
3,
)
[input/code.rs:59] &node = (
4,
3,
)
[input/code.rs:59] &node = (
4,
4,
)
[input/code.rs:59] &node = (
5,
4,
)
[input/code.rs:59] &node = (
5,
5,
)
[input/code.rs:59] &node = (
6,
5,
)
[input/code.rs:59] &node = (
6,
6,
)
[input/code.rs:59] &node = (
7,
6,
)
[input/code.rs:59] &node = (
7,
7,
)
[input/code.rs:59] &node = (
8,
7,
)
[input/code.rs:59] &node = (
8,
8,
)
[input/code.rs:59] &node = (
9,
8,
)
[input/code.rs:59] &node = (
9,
9,
)
[input/code.rs:59] &node = (
10,
9,
)
[input/code.rs:59] &node = (
10,
10,
)
[input/code.rs:59] &node = (
11,
10,
)
[inpu...Test 22
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| input |
|---|
| 10 1 10 * * . * ... |
| correct output |
|---|
| 0 1 1 0 0 ... |
| user output |
|---|
| 0 1 1 0 0 ... |
Error:
[input/code.rs:59] &node = (
2,
0,
)
[input/code.rs:59] &node = (
5,
0,
)
[input/code.rs:59] &node = (
9,
0,
)
[input/code.rs:59] &node = (
9,
0,
)
[input/code.rs:59] &node = (
5,
0,
)
[input/code.rs:59] &node = (
5,
0,
)Test 23
Group: 1, 2, 3, 4, 5
Verdict: ACCEPTED
| 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 ... |
Error:
[input/code.rs:59] &node = (
0,
6,
)
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
0,
1,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
0,
4,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
0,
7,
)
[input/code.rs:59] &node = (
0,
9,
)
[input/code.rs:59] &node = (
0,
4,
)
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
0,
1,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
0,
7,
)
[input/code.rs:59] &node = (
0,
9,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
0,
0,
)
[input/code.rs:59] &node = (
0,
1,
)
[input/code.rs:59] &node = (
0,
2,
)
[input/code.rs:59] &node = (
0,
3,
)
[input/cod...Test 24
Group: 5
Verdict: ACCEPTED
| input |
|---|
| 250 1 200000 * . * . ... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Error:
[input/code.rs:59] &node = (
46,
0,
)
[input/code.rs:59] &node = (
1,
0,
)
[input/code.rs:59] &node = (
3,
0,
)
[input/code.rs:59] &node = (
4,
0,
)
[input/code.rs:59] &node = (
7,
0,
)
[input/code.rs:59] &node = (
9,
0,
)
[input/code.rs:59] &node = (
13,
0,
)
[input/code.rs:59] &node = (
14,
0,
)
[input/code.rs:59] &node = (
17,
0,
)
[input/code.rs:59] &node = (
18,
0,
)
[input/code.rs:59] &node = (
22,
0,
)
[input/code.rs:59] &node = (
25,
0,
)
[input/code.rs:59] &node = (
30,
0,
)
[input/code.rs:59] &node = (
31,
0,
)
[input/code.rs:59] &node = (
32,
0,
)
[input/code.rs:59] &node = (
34,
0,
)
[input/code.rs:59] &node = (
35,
0,
)
[input/code.rs:59] &node = (
36,
0,
)
[input/code.rs:59] &node = (
41,
0,
)
[input/code.rs:59] &node = (
42,
0,
)
[input/code.rs:59] &node = (
43,
0,
)
[input/code.rs:59] &node = (
45,...Test 25
Group: 5
Verdict: ACCEPTED
| input |
|---|
| 1 250 200000 *.*.*...*.*.**.***..**.*.*..**... |
| correct output |
|---|
| 1 1 1 1 1 ... |
| user output |
|---|
| 1 1 1 1 1 ... |
Error:
[input/code.rs:59] &node = (
0,
3,
)
[input/code.rs:59] &node = (
0,
1,
)
[input/code.rs:59] &node = (
0,
5,
)
[input/code.rs:59] &node = (
0,
6,
)
[input/code.rs:59] &node = (
0,
7,
)
[input/code.rs:59] &node = (
0,
9,
)
[input/code.rs:59] &node = (
0,
11,
)
[input/code.rs:59] &node = (
0,
14,
)
[input/code.rs:59] &node = (
0,
18,
)
[input/code.rs:59] &node = (
0,
19,
)
[input/code.rs:59] &node = (
0,
22,
)
[input/code.rs:59] &node = (
0,
24,
)
[input/code.rs:59] &node = (
0,
26,
)
[input/code.rs:59] &node = (
0,
27,
)
[input/code.rs:59] &node = (
0,
32,
)
[input/code.rs:59] &node = (
0,
34,
)
[input/code.rs:59] &node = (
0,
36,
)
[input/code.rs:59] &node = (
0,
39,
)
[input/code.rs:59] &node = (
0,
40,
)
[input/code.rs:59] &node = (
0,
41,
)
[input/code.rs:59] &node = (
0,
42,
)
[input/code.rs:59] &node = (
0,...Test 26
Group: 5
Verdict: TIME LIMIT EXCEEDED
| input |
|---|
| 250 250 200000 ................................. |
| correct output |
|---|
| 2 2 2 2 2 ... |
| user output |
|---|
| (empty) |
Test 27
Group: 5
Verdict: ACCEPTED
| input |
|---|
| 250 250 200000 ******************************... |
| correct output |
|---|
| 0 0 0 0 0 ... |
| user output |
|---|
| 0 0 0 0 0 ... |
Error:
[input/code.rs:59] &node = (
249,
249,
)