Submission details
Task:Buzzwords
Sender:aalto26im_009
Submission time:2026-11-02 17:38:16 +0200
Language:Rust (2021)
Status:READY
Result:
Test results
testverdicttime
#10.00 sdetails
#20.00 sdetails
#30.00 sdetails
#40.00 sdetails
#50.00 sdetails
#60.00 sdetails
#70.00 sdetails
#80.00 sdetails
#90.00 sdetails
#100.00 sdetails
#110.00 sdetails
#120.00 sdetails
#130.00 sdetails
#140.00 sdetails
#150.00 sdetails
#160.00 sdetails
#170.00 sdetails
#180.00 sdetails
#190.00 sdetails
#200.00 sdetails
#210.00 sdetails
#220.00 sdetails
#230.00 sdetails
#240.00 sdetails
#250.00 sdetails
#260.00 sdetails
#270.00 sdetails
#280.00 sdetails
#290.00 sdetails
#300.00 sdetails
#310.00 sdetails
#320.00 sdetails
#330.00 sdetails
#340.00 sdetails
#350.00 sdetails
#360.00 sdetails
#370.00 sdetails
#380.00 sdetails
#390.00 sdetails
#400.00 sdetails
#410.00 sdetails
#420.00 sdetails
#430.00 sdetails
#440.00 sdetails

Code

#![allow(unused)]

use std::io;
use std::{
    collections::*,
    io::{prelude::*, *},
};

fn take_tuple() -> (usize, usize) {
    let mut input = String::new();
    io::stdin().read_line(&mut input).unwrap();
    let mut it = input
        .trim()
        .split_whitespace()
        .map(|x| x.parse::<usize>().unwrap());
    (it.next().unwrap(), it.next().unwrap())
}

fn main() {
    let (n, m) = take_tuple();

    if m % 2 == 1 {
        if n % 2 == 1 {
            println!("-1");
            return;
        } else {
            for _ in 0..n - 1 {
                print!("D");
            }
            print!("R");

            for i in 0..n >> 1 {
                for _ in 1..m - 1 {
                    print!("R");
                }
                print!("U");
                for _ in 1..m - 1 {
                    print!("L");
                }
                if i + 1 != n >> 1 {
                    print!("U");
                }
            }

            print!("L");
        }
    } else {
        for _ in 0..n - 1 {
            print!("D");
        }
        for _ in 1..m / 2 {
            print!("R");
            for _ in 1..n - 1 {
                print!("U");
            }
            print!("R");
            for _ in 1..n-1 {
                print!("D");
            }
        }
        print!("R");
        for _ in 0..n - 1 {
            print!("U")
        }
        for i in 0..m - 1 {
            print!("L")
        }
    }
}

Test details

Test 1

Verdict:

input
g fhe
395
a
aa
aafh
...

correct output
10

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 2

Verdict:

input
s adh
372
a
ad
ae
...

correct output
6

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 3

Verdict:

input
adcdb
20
a
aa
ab
...

correct output
9

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 4

Verdict:

input
aaaaa
5
a
aa
aaa
...

correct output
15

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 5

Verdict:

input
o zws
759
a
ab
abw
...

correct output
8

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 6

Verdict:

input
aaaaa
5
a
aa
aaa
...

correct output
15

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 7

Verdict:

input
ifv b
649
a
aaw
ac
...

correct output
10

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 8

Verdict:

input
dbbdc
129
a
aa
aaab
...

correct output
15

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 9

Verdict:

input
aaaaa
5
a
aa
aaa
...

correct output
15

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 10

Verdict:

input
eeeab
9
a
b
c
...

correct output
5

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 11

Verdict:

input
ghfhe d fd
430
a
aa
aafa
...

correct output
22

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 12

Verdict:

input
syadhzdgck
275
a
ad
adh
...

correct output
53

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 13

Verdict:

input
adcdbbbbba
256
a
aa
aaa
...

correct output
49

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 14

Verdict:

input
aaaaaaaaaa
10
a
aa
aaa
...

correct output
55

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 15

Verdict:

input
o zwspspfd
468
a
adks
afhsrhvwxn
...

correct output
45

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 16

Verdict:

input
aaaaaaaaaa
10
a
aa
aaa
...

correct output
55

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 17

Verdict:

input
i vbbjczpc
703
a
aa
abou
...

correct output
29

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 18

Verdict:

input
d bdcbdbcb
128
a
aa
aab
...

correct output
42

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 19

Verdict:

input
aaaaaaaaaa
10
a
aa
aaa
...

correct output
55

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 20

Verdict:

input
eeeabcbabh
171
a
aac
aahg
...

correct output
34

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 21

Verdict:

input
ghfhehdf ddciaicdehheefdihadaf...

correct output
246

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 22

Verdict:

input
s adhzdgckekirkyowkirnflwfanrx...

correct output
52

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 23

Verdict:

input
adcdbbbbbaaccabbbccd cabccacdb...

correct output
178

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 24

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
2518

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 25

Verdict:

input
oezws spfdzfasgxlquafowjzpe pv...

correct output
284

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 26

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
1387

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 27

Verdict:

input
ifvbbjczpcnpknimqvlttkngpe szx...

correct output
258

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 28

Verdict:

input
dbbdcbdb bcaabb bccddbbbacbcdc...

correct output
36

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 29

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
3076

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 30

Verdict:

input
e eabcbabhdbcbaddebchdiga ggfb...

correct output
23

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 31

Verdict:

input
ghfhehdff dci icdehheefdih daf...

correct output
248

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 32

Verdict:

input
s a hzdgckekirkyo kirnflw anrx...

correct output
27

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 33

Verdict:

input
adcdbbb baac abbbcc c abccacd ...

correct output
433

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 34

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
3427

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 35

Verdict:

input
oezwsp pf z asgxlquafowjzpekpv...

correct output
359

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 36

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
2126

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 37

Verdict:

input
ifvbbjczpcnpk imqvlttkngpeqszx...

correct output
395

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 38

Verdict:

input
dbbdcbd cbcaabbabccddbb acbcdc...

correct output
242

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 39

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
4287

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 40

Verdict:

input
eeeabcbabhd cb ddebchdigaiggfb...

correct output
15

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 41

Verdict:

input
ghfhehdffdd i icdehheefd hadaf...

correct output
431

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 42

Verdict:

input
syadhzdgckekirkyow irnflwfanrx...

correct output
8039

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 43

Verdict:

input
adcdbbbbbaaccabb ccdccabcc cdb...

correct output
9409

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace

Test 44

Verdict:

input
aaaaaaaaaaaaaaaaaaaaaaaaaaaaaa...

correct output
168696

user output
(empty)

Error:
thread 'main' panicked at input/code.rs:15:37:
called `Result::unwrap()` on an `Err` value: ParseIntError { kind: InvalidDigit }
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace