結果

問題 No.5006 Hidden Maze
ユーザー ntk-ta01
提出日時 2022-06-12 14:22:22
言語 Rust
(1.83.0 + proconio)
結果
AC  
実行時間 49 ms / 2,000 ms
コード長 1,957 bytes
コンパイル時間 783 ms
実行使用メモリ 22,876 KB
スコア 0
平均クエリ数 1001.00
最終ジャッジ日時 2022-06-12 14:22:34
合計ジャッジ時間 9,455 ms
ジャッジサーバーID
(参考情報)
judge13 / judge11
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 100
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `input`
  --> Main.rs:51:9
   |
51 |     let input = parse_input();
   |         ^^^^^ help: if this is intentional, prefix it with an underscore: `_input`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: constant is never used: `TIMELIMIT`
  --> Main.rs:40:1
   |
40 | const TIMELIMIT: f64 = 1.935;
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: constant is never used: `DIJ`
  --> Main.rs:41:1
   |
41 | const DIJ: [(usize, usize); 4] = [(0, !0), (!0, 0), (0, 1), (1, 0)];
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: constant is never used: `DIR`
  --> Main.rs:42:1
   |
42 | const DIR: [char; 4] = ['L', 'U', 'R', 'D'];
   | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

warning: field is never read: `h`
  --> Main.rs:45:5
   |
45 |     pub h: usize,
   |     ^^^^^^^^^^^^

warning: field is never read: `w`
  --> Main.rs:46:5
   |
46 |     pub w: usize,
   |     ^^^^^^^^^^^^

warning: field is never read: `p`
  --> Main.rs:47:5
   |
47 |     pub p: usize,
   |     ^^^^^^^^^^^^

warning: 7 warnings emitted

ソースコード

diff #

macro_rules! input {
    ($($r:tt)*) => {
        let stdin = std::io::stdin();
        let mut bytes = std::io::Read::bytes(std::io::BufReader::new(stdin.lock()));
        let mut next = move || -> String{
            bytes.by_ref().map(|r|r.unwrap() as char)
                .skip_while(|c|c.is_whitespace())
                .take_while(|c|!c.is_whitespace())
                .collect()
        };
        input_inner!{next, $($r)*}
    };
}

macro_rules! input_inner {
    ($next:expr) => {};
    ($next:expr,) => {};
    ($next:expr, $var:ident : $t:tt $($r:tt)*) => {
        let $var = read_value!($next, $t);
        input_inner!{$next $($r)*}
    };
}

macro_rules! read_value {
    ($next:expr, ( $($t:tt),* )) => { ($(read_value!($next, $t)),*) };
    ($next:expr, [ $t:tt ; $len:expr ]) => {
        (0..$len).map(|_| read_value!($next, $t)).collect::<Vec<_>>()
    };
    ($next:expr, chars) => {
        read_value!($next, String).chars().collect::<Vec<char>>()
    };
    ($next:expr, usize1) => (read_value!($next, usize) - 1);
    ($next:expr, [ $t:tt ]) => {{
        let len = read_value!($next, usize);
        read_value!($next, [$t; len])
    }};
    ($next:expr, $t:ty) => ($next().parse::<$t>().expect("Parse error"));
}

const TIMELIMIT: f64 = 1.935;
const DIJ: [(usize, usize); 4] = [(0, !0), (!0, 0), (0, 1), (1, 0)];
const DIR: [char; 4] = ['L', 'U', 'R', 'D'];

struct Input {
    pub h: usize,
    pub w: usize,
    pub p: usize,
}

fn main() {
    let input = parse_input();
    loop {
        println!("DDDDDDDDDDDDDDDDDDDRRRRRRRRRRRRRRRRRRR");
        let feed = {
            let mut s = String::new();
            std::io::stdin().read_line(&mut s).unwrap();
            let s = s.trim();
            s.parse::<i32>().unwrap()
        };
        if feed == -1 {
            break;
        }
    }
}

fn parse_input() -> Input {
    input!{
        h: usize,
        w: usize,
        p: usize,
    }
    Input { h, w, p }
}
0