| Task: | Monikulmio |
| Sender: | vulpesomnia |
| Submission time: | 2025-10-27 11:45:15 +0200 |
| Language: | Rust (2021) |
| Status: | READY |
| Result: | 0 |
| group | verdict | score |
|---|---|---|
| #1 | WRONG ANSWER | 0 |
| test | verdict | time | score | |
|---|---|---|---|---|
| #1 | WRONG ANSWER | 0.00 s | 0 | details |
| #2 | WRONG ANSWER | 0.00 s | 0 | details |
| #3 | WRONG ANSWER | 0.00 s | 0 | details |
| #4 | WRONG ANSWER | 0.00 s | 0 | details |
| #5 | WRONG ANSWER | 0.00 s | 0 | details |
| #6 | WRONG ANSWER | 0.00 s | 0 | details |
| #7 | WRONG ANSWER | 0.00 s | 0 | details |
| #8 | WRONG ANSWER | 0.00 s | 0 | details |
| #9 | WRONG ANSWER | 0.01 s | 0 | details |
| #10 | WRONG ANSWER | 0.03 s | 0 | details |
Compiler report
warning: unused variable: `i`
--> input/code.rs:14:9
|
14 | for i in 0..k {
| ^ help: if this is intentional, prefix it with an underscore: `_i`
|
= note: `#[warn(unused_variables)]` on by default
warning: unused variable: `j`
--> input/code.rs:44:17
|
44 | for j in 0..dy.abs() {
| ^ help: if this is intentional, prefix it with an underscore: `_j`
warning: unused variable: `j`
--> input/code.rs:51:17
|
51 | for j in 0..dx.abs() {
| ^ help: if this is intentional, prefix it with an underscore: `_j`
warning: unused variable: `step_y`
--> input/code.rs:60:17
|
60 | let step_y = dy/(dy.abs());
| ^^^^^^ help: if this is intentional, prefix it with an underscore: `_step_y`
warning: unused variable: `j`
--> input/code.rs:61:17
|
61 | for j in 0..dx.abs() {
| ^ help: if this is intentional, prefix it with an underscore: `_...Code
use std::io;
fn main() {
let mut input = String::new();
io::stdin().read_line(&mut input).expect("failed to readline");
let mut iter = input.trim().split_whitespace();
let (n, m, k): (i32, i32, i32) = (
iter.next().unwrap().parse().unwrap(),
iter.next().unwrap().parse().unwrap(),
iter.next().unwrap().parse().unwrap(),
);
let mut points: Vec<(i32, i32)> = Vec::new();
for i in 0..k {
let mut point = String::new();
io::stdin().read_line(&mut point).expect("failed to readline");
let mut iter2 = point.trim().split_whitespace();
let (x, y): (i32, i32) = (
iter2.next().unwrap().parse().unwrap(),
iter2.next().unwrap().parse().unwrap(),
);
points.push((x, y));
}
let mut descending: Vec<(i32, i32)> = Vec::new();
let mut ascending: Vec<(i32, i32)> = Vec::new();
let mut horizontal: Vec<(i32, i32)> = Vec::new();
let mut vertical: Vec<(i32, i32)> = Vec::new();
let size = points.len();
for (i, (px, py)) in points.clone().into_iter().enumerate() {
let p1: (i32, i32) = (px, py);
let p2: (i32, i32);
if i == size - 1 {
p2 = points[0];
} else {
p2 = points[i+1];
}
let dx = p2.0 - p1.0;
let dy = p2.1 - p1.1;
if dx == 0 { // Vertical
let mut ny = p1.1;
let step = dy/(dy.abs());
for j in 0..dy.abs() {
vertical.push((p1.0, ny));
ny += step;
}
} else if dy == 0 { // Horizontal
let mut nx = p1.0;
let step = dx/(dx.abs());
for j in 0..dx.abs() {
horizontal.push((nx ,p1.1));
nx += step;
}
} else {
let k = dy/dx;
let mut nx = p1.0;
let mut ny = p1.1;
let step_x = dx/(dx.abs());
let step_y = dy/(dy.abs());
for j in 0..dx.abs() {
if k == 1 { // Ascending
ascending.push((nx ,ny));
} else {
descending.push((nx ,ny));
}
nx += step_x;
ny += step_x;
}
}
}
for i in 0..n {
let mut line = String::new();
'row: for j in 0..m {
for (x, y) in &points {
if (j + 1, i + 1) == (*x, *y) {
line.push('*');
continue 'row;
}
}
for (x, y) in &horizontal {
if (j + 1, i + 1) == (*x, *y) {
line.push('=');
continue 'row;
}
}
for (x, y) in &vertical {
if (j + 1, i + 1) == (*x, *y) {
line.push('|');
continue 'row;
}
}
for (x, y) in &ascending {
if (j + 1, i + 1) == (*x, *y) {
line.push('/');
continue 'row;
}
}
for (x, y) in &descending {
if (j + 1, i + 1) == (*x, *y) {
line.push('\\');
continue 'row;
}
}
line.push('.');
}
println!("{}", line);
}
}
Test details
Test 1 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 8 9 5 5 2 2 5 5 8 7 8 ... |
| correct output |
|---|
| ......... ....*.... .../#\... ../###\.. .*#####*. ... |
| user output |
|---|
| ...\..... ....*=*.. ......|.. ......|.. .*....|.. ... |
Feedback: Incorrect character on row 1, col 4: expected '.', got '\'
Test 2 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 4 5 10 5 30 15 30 15 10 |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 5, col 10: expected '*', got '.'
Test 3 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 29 8 7 13 2 14 2 9 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ............\.................... |
Feedback: Incorrect character on row 1, col 13: expected '.', got '\'
Test 4 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 14 5 12 5 25 8 28 13 28 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 3, col 9: expected '*', got '.'
Test 5 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 20 40 12 3 20 7 16 7 9 11 13 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 3, col 20: expected '*', got '.'
Test 6 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 9 35 33 2 3 2 8 4 8 4 5 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 2, col 7: expected '=', got '*'
Test 7 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 30 100 69 6 10 6 14 7 14 7 18 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| .................*===========*... |
Feedback: Incorrect character on row 1, col 18: expected '.', got '*'
Test 8 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 40 60 192 11 3 11 5 10 6 11 7 ... |
| correct output |
|---|
| ................................. |
| user output |
|---|
| ................................. |
Feedback: Incorrect character on row 2, col 30: expected '*', got '.'
Test 9 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 50 100 142 1 1 1 7 1 11 1 14 ... |
| correct output |
|---|
| *=====*===*==*................... |
| user output |
|---|
| *=*=**.....*========*=======*.... |
Feedback: Incorrect character on row 1, col 3: expected '=', got '*'
Test 10 (public)
Verdict: WRONG ANSWER
| input |
|---|
| 100 100 1000 10 1 4 7 1 4 1 9 ... |
| correct output |
|---|
| ...*====*........................ |
| user output |
|---|
| .........**........*..*.......... |
Feedback: Incorrect character on row 1, col 4: expected '*', got '.'
