結果

問題 No.5017 Tool-assisted Shooting
ユーザー 👑 tipstar0125tipstar0125
提出日時 2023-07-16 14:09:55
言語 Rust
(1.77.0)
結果
AC  
実行時間 29 ms / 2,000 ms
コード長 6,122 bytes
コンパイル時間 8,009 ms
コンパイル使用メモリ 153,736 KB
実行使用メモリ 24,408 KB
スコア 74,830
平均クエリ数 1.00
最終ジャッジ日時 2023-07-16 14:10:10
合計ジャッジ時間 10,043 ms
ジャッジサーバーID
(参考情報)
judge13 / judge15
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 28 ms
24,048 KB
testcase_01 AC 25 ms
23,496 KB
testcase_02 AC 23 ms
23,532 KB
testcase_03 AC 22 ms
24,012 KB
testcase_04 AC 23 ms
24,264 KB
testcase_05 AC 23 ms
23,820 KB
testcase_06 AC 25 ms
23,832 KB
testcase_07 AC 24 ms
23,832 KB
testcase_08 AC 23 ms
23,364 KB
testcase_09 AC 23 ms
24,312 KB
testcase_10 AC 26 ms
24,396 KB
testcase_11 AC 23 ms
24,276 KB
testcase_12 AC 22 ms
23,628 KB
testcase_13 AC 23 ms
24,348 KB
testcase_14 AC 24 ms
24,348 KB
testcase_15 AC 23 ms
23,364 KB
testcase_16 AC 23 ms
23,400 KB
testcase_17 AC 26 ms
24,000 KB
testcase_18 AC 25 ms
23,868 KB
testcase_19 AC 22 ms
23,376 KB
testcase_20 AC 27 ms
24,372 KB
testcase_21 AC 25 ms
23,628 KB
testcase_22 AC 24 ms
23,652 KB
testcase_23 AC 23 ms
24,252 KB
testcase_24 AC 24 ms
24,348 KB
testcase_25 AC 23 ms
23,628 KB
testcase_26 AC 24 ms
24,012 KB
testcase_27 AC 25 ms
24,336 KB
testcase_28 AC 23 ms
23,412 KB
testcase_29 AC 28 ms
23,532 KB
testcase_30 AC 23 ms
23,400 KB
testcase_31 AC 22 ms
23,520 KB
testcase_32 AC 22 ms
24,372 KB
testcase_33 AC 23 ms
23,508 KB
testcase_34 AC 26 ms
24,000 KB
testcase_35 AC 23 ms
23,364 KB
testcase_36 AC 24 ms
23,628 KB
testcase_37 AC 24 ms
24,036 KB
testcase_38 AC 23 ms
23,376 KB
testcase_39 AC 27 ms
24,012 KB
testcase_40 AC 23 ms
23,400 KB
testcase_41 AC 22 ms
24,252 KB
testcase_42 AC 24 ms
23,832 KB
testcase_43 AC 24 ms
24,036 KB
testcase_44 AC 22 ms
23,520 KB
testcase_45 AC 23 ms
24,012 KB
testcase_46 AC 25 ms
24,012 KB
testcase_47 AC 23 ms
23,232 KB
testcase_48 AC 27 ms
23,424 KB
testcase_49 AC 25 ms
24,024 KB
testcase_50 AC 23 ms
23,364 KB
testcase_51 AC 26 ms
24,408 KB
testcase_52 AC 27 ms
23,640 KB
testcase_53 AC 24 ms
24,012 KB
testcase_54 AC 23 ms
23,508 KB
testcase_55 AC 27 ms
23,832 KB
testcase_56 AC 25 ms
24,024 KB
testcase_57 AC 26 ms
24,012 KB
testcase_58 AC 25 ms
23,616 KB
testcase_59 AC 23 ms
23,364 KB
testcase_60 AC 25 ms
23,388 KB
testcase_61 AC 27 ms
23,640 KB
testcase_62 AC 29 ms
23,376 KB
testcase_63 AC 23 ms
23,652 KB
testcase_64 AC 22 ms
24,396 KB
testcase_65 AC 25 ms
23,520 KB
testcase_66 AC 22 ms
24,312 KB
testcase_67 AC 22 ms
23,364 KB
testcase_68 AC 23 ms
24,012 KB
testcase_69 AC 28 ms
23,388 KB
testcase_70 AC 23 ms
24,324 KB
testcase_71 AC 23 ms
23,616 KB
testcase_72 AC 23 ms
23,412 KB
testcase_73 AC 25 ms
23,352 KB
testcase_74 AC 23 ms
24,252 KB
testcase_75 AC 22 ms
23,412 KB
testcase_76 AC 23 ms
23,808 KB
testcase_77 AC 23 ms
23,820 KB
testcase_78 AC 23 ms
24,024 KB
testcase_79 AC 24 ms
24,276 KB
testcase_80 AC 23 ms
23,640 KB
testcase_81 AC 24 ms
24,276 KB
testcase_82 AC 23 ms
24,264 KB
testcase_83 AC 23 ms
24,312 KB
testcase_84 AC 23 ms
24,012 KB
testcase_85 AC 23 ms
23,412 KB
testcase_86 AC 24 ms
23,628 KB
testcase_87 AC 25 ms
23,520 KB
testcase_88 AC 22 ms
23,532 KB
testcase_89 AC 28 ms
24,264 KB
testcase_90 AC 23 ms
23,628 KB
testcase_91 AC 23 ms
24,252 KB
testcase_92 AC 26 ms
23,664 KB
testcase_93 AC 22 ms
23,532 KB
testcase_94 AC 23 ms
23,616 KB
testcase_95 AC 25 ms
23,616 KB
testcase_96 AC 26 ms
24,276 KB
testcase_97 AC 22 ms
24,252 KB
testcase_98 AC 22 ms
23,388 KB
testcase_99 AC 23 ms
24,312 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `HPX`
   --> Main.rs:132:13
    |
132 |             HPX: [(usize,usize,usize); N]
    |             ^^^ help: if this is intentional, prefix it with an underscore: `_HPX`
    |
    = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

ソースコード

diff #

#![allow(non_snake_case)]
#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(clippy::comparison_chain)]
#![allow(clippy::nonminimal_bool)]
#![allow(clippy::neg_multiply)]
#![allow(clippy::type_complexity)]
#![allow(clippy::needless_range_loop)]
#![allow(dead_code)]

use std::{
    cmp::Reverse,
    collections::{BTreeMap, BTreeSet, BinaryHeap, VecDeque},
};

mod rnd {
    static mut S: usize = 0;
    static MAX: usize = 1e9 as usize;

    #[inline]
    pub fn init(seed: usize) {
        unsafe {
            if seed == 0 {
                let t = std::time::SystemTime::now()
                    .duration_since(std::time::UNIX_EPOCH)
                    .unwrap()
                    .as_secs() as usize;
                S = t
            } else {
                S = seed;
            }
        }
    }
    #[inline]
    pub fn gen() -> usize {
        unsafe {
            if S == 0 {
                init(0);
            }
            S ^= S << 7;
            S ^= S >> 9;
            S
        }
    }
    #[inline]
    pub fn gen_range(a: usize, b: usize) -> usize {
        gen() % (b - a) + a
    }
    #[inline]
    pub fn gen_bool() -> bool {
        gen() & 1 == 1
    }
    #[inline]
    pub fn gen_range_isize(a: usize) -> isize {
        let mut x = (gen() % a) as isize;
        if gen_bool() {
            x *= -1;
        }
        x
    }
    #[inline]
    pub fn gen_range_neg_wrapping(a: usize) -> usize {
        let mut x = gen() % a;
        if gen_bool() {
            x = x.wrapping_neg();
        }
        x
    }
    #[inline]
    pub fn gen_float() -> f64 {
        ((gen() % MAX) as f64) / MAX as f64
    }
}

#[derive(Debug, Clone)]
struct TimeKeeper {
    start_time: std::time::Instant,
    time_threshold: f64,
}

impl TimeKeeper {
    fn new(time_threshold: f64) -> Self {
        TimeKeeper {
            start_time: std::time::Instant::now(),
            time_threshold,
        }
    }
    #[inline]
    fn isTimeOver(&self) -> bool {
        let elapsed_time = self.start_time.elapsed().as_nanos() as f64 * 1e-9;
        #[cfg(feature = "local")]
        {
            elapsed_time * 1.5 >= self.time_threshold
        }
        #[cfg(not(feature = "local"))]
        {
            elapsed_time >= self.time_threshold
        }
    }
    #[inline]
    fn get_time(&self) -> f64 {
        let elapsed_time = self.start_time.elapsed().as_nanos() as f64 * 1e-9;
        #[cfg(feature = "local")]
        {
            elapsed_time * 1.5
        }
        #[cfg(not(feature = "local"))]
        {
            elapsed_time
        }
    }
}

#[derive(Debug, Clone)]
struct State {}

// impl State {
//     fn new() -> Self {}
// }

#[derive(Default)]
struct Solver {}
impl Solver {
    fn solve(&mut self) {
        input! {
            N: isize
        }
        if N == -1 {
            return;
        }
        input! {
            HPX: [(usize,usize,usize); N]
        }
        println!("S");
    }
}

fn main() {
    std::thread::Builder::new()
        .stack_size(128 * 1024 * 1024)
        .spawn(|| Solver::default().solve())
        .unwrap()
        .join()
        .unwrap();
}

#[macro_export]
macro_rules! input {
    () => {};
    (mut $var:ident: $t:tt, $($rest:tt)*) => {
        let mut $var = __input_inner!($t);
        input!($($rest)*)
    };
    ($var:ident: $t:tt, $($rest:tt)*) => {
        let $var = __input_inner!($t);
        input!($($rest)*)
    };
    (mut $var:ident: $t:tt) => {
        let mut $var = __input_inner!($t);
    };
    ($var:ident: $t:tt) => {
        let $var = __input_inner!($t);
    };
}

#[macro_export]
macro_rules! __input_inner {
    (($($t:tt),*)) => {
        ($(__input_inner!($t)),*)
    };
    ([$t:tt; $n:expr]) => {
        (0..$n).map(|_| __input_inner!($t)).collect::<Vec<_>>()
    };
    ([$t:tt]) => {{
        let n = __input_inner!(usize);
        (0..n).map(|_| __input_inner!($t)).collect::<Vec<_>>()
    }};
    (chars) => {
        __input_inner!(String).chars().collect::<Vec<_>>()
    };
    (bytes) => {
        __input_inner!(String).into_bytes()
    };
    (usize1) => {
        __input_inner!(usize) - 1
    };
    ($t:ty) => {
        $crate::read::<$t>()
    };
}

#[macro_export]
macro_rules! println {
    () => {
        $crate::write(|w| {
            use std::io::Write;
            std::writeln!(w).unwrap()
        })
    };
    ($($arg:tt)*) => {
        $crate::write(|w| {
            use std::io::Write;
            std::writeln!(w, $($arg)*).unwrap()
        })
    };
}

#[macro_export]
macro_rules! print {
    ($($arg:tt)*) => {
        $crate::write(|w| {
            use std::io::Write;
            std::write!(w, $($arg)*).unwrap()
        })
    };
}

#[macro_export]
macro_rules! flush {
    () => {
        $crate::write(|w| {
            use std::io::Write;
            w.flush().unwrap()
        })
    };
}

pub fn read<T>() -> T
where
    T: std::str::FromStr,
    T::Err: std::fmt::Debug,
{
    use std::cell::RefCell;
    use std::io::*;

    thread_local! {
        pub static STDIN: RefCell<StdinLock<'static>> = RefCell::new(stdin().lock());
    }

    STDIN.with(|r| {
        let mut r = r.borrow_mut();
        let mut s = vec![];
        loop {
            let buf = r.fill_buf().unwrap();
            if buf.is_empty() {
                break;
            }
            if let Some(i) = buf.iter().position(u8::is_ascii_whitespace) {
                s.extend_from_slice(&buf[..i]);
                r.consume(i + 1);
                if !s.is_empty() {
                    break;
                }
            } else {
                s.extend_from_slice(buf);
                let n = buf.len();
                r.consume(n);
            }
        }
        std::str::from_utf8(&s).unwrap().parse().unwrap()
    })
}

pub fn write<F>(f: F)
where
    F: FnOnce(&mut std::io::BufWriter<std::io::StdoutLock>),
{
    use std::cell::RefCell;
    use std::io::*;

    thread_local! {
        pub static STDOUT: RefCell<BufWriter<StdoutLock<'static>>> =
            RefCell::new(BufWriter::new(stdout().lock()));
    }

    STDOUT.with(|w| f(&mut w.borrow_mut()))
}
0