Submission #5400709


Source Code Expand

#![allow(unused_mut)]
#![allow(non_snake_case)]
#![allow(unused_macros)]
#![allow(unused_variables)]
#![allow(unused_imports)]
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8
macro_rules! input {
    (source = $s:expr, $($r:tt)*) => {
        let mut iter = $s.split_whitespace();
        let mut next = || { iter.next().unwrap() };
        input_inner!{next, $($r)*}
    };
    ($($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 mut $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:ty) => {
        $next().parse::<$t>().expect("Parse error")
    };
}

macro_rules! max {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::max($x, max!($($y),+))
    };
}

macro_rules! min {
    ($x: expr) => ($x);
    ($x: expr, $($y: expr),+) => {
        ::std::cmp::min($x, max!($($y),+))
    };
}

use std::cmp;
use std::collections::{HashSet, BinaryHeap, VecDeque};
use std::iter::FromIterator;
fn main() {
    input!{
        x: usize,
    }

    let mut times = (x / 11) * 2;
    let res = x % 11;
    match res {
        1...6 => times += 1,
        7...11 => times += 2,
        _ => panic!(),
    }
    println!("{}", times);
}

Submission Info

Submission Time
Task C - X: Yet Another Die Game
User tsucchee
Language Rust (1.15.1)
Score 0
Code Size 2253 Byte
Status RE
Exec Time 2 ms
Memory 4352 KB

Compile Error

warning: unknown lint: `unused_macros`, #[warn(unknown_lints)] on by default
 --> ./Main.rs:3:10
  |
3 | #![allow(unused_macros)]
  |          ^^^^^^^^^^^^^

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 2
AC × 16
RE × 2
Set Name Test Cases
Sample 00_example_01.txt, 00_example_02.txt
All 00_example_01.txt, 00_example_02.txt, 01.txt, 02.txt, 03.txt, 04.txt, 05.txt, 06.txt, 07.txt, 08.txt, 09.txt, 10.txt, 11.txt, 12.txt, 13.txt, 14.txt, 15.txt, 16.txt
Case Name Status Exec Time Memory
00_example_01.txt AC 2 ms 4352 KB
00_example_02.txt AC 2 ms 4352 KB
01.txt AC 2 ms 4352 KB
02.txt AC 2 ms 4352 KB
03.txt AC 2 ms 4352 KB
04.txt AC 2 ms 4352 KB
05.txt AC 2 ms 4352 KB
06.txt AC 2 ms 4352 KB
07.txt AC 2 ms 4352 KB
08.txt AC 2 ms 4352 KB
09.txt AC 2 ms 4352 KB
10.txt AC 2 ms 4352 KB
11.txt RE 2 ms 4352 KB
12.txt AC 2 ms 4352 KB
13.txt RE 2 ms 4352 KB
14.txt AC 2 ms 4352 KB
15.txt AC 2 ms 4352 KB
16.txt AC 2 ms 4352 KB