結果

問題 No.5017 Tool-assisted Shooting
ユーザー gobi_503gobi_503
提出日時 2023-07-16 14:19:25
言語 Rust
(1.77.0)
結果
AC  
実行時間 59 ms / 2,000 ms
コード長 2,756 bytes
コンパイル時間 1,182 ms
コンパイル使用メモリ 153,084 KB
実行使用メモリ 24,384 KB
スコア 74,830
平均クエリ数 399.74
最終ジャッジ日時 2023-07-16 14:19:35
合計ジャッジ時間 9,691 ms
ジャッジサーバーID
(参考情報)
judge14 / judge13
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 30 ms
24,024 KB
testcase_01 AC 59 ms
24,372 KB
testcase_02 AC 29 ms
24,048 KB
testcase_03 AC 27 ms
23,412 KB
testcase_04 AC 35 ms
23,616 KB
testcase_05 AC 33 ms
23,424 KB
testcase_06 AC 27 ms
23,628 KB
testcase_07 AC 37 ms
23,424 KB
testcase_08 AC 28 ms
23,364 KB
testcase_09 AC 31 ms
24,360 KB
testcase_10 AC 37 ms
23,520 KB
testcase_11 AC 30 ms
23,412 KB
testcase_12 AC 27 ms
23,664 KB
testcase_13 AC 32 ms
23,832 KB
testcase_14 AC 31 ms
24,036 KB
testcase_15 AC 28 ms
24,012 KB
testcase_16 AC 26 ms
24,012 KB
testcase_17 AC 59 ms
23,832 KB
testcase_18 AC 58 ms
23,364 KB
testcase_19 AC 30 ms
24,276 KB
testcase_20 AC 33 ms
23,628 KB
testcase_21 AC 33 ms
23,652 KB
testcase_22 AC 38 ms
24,372 KB
testcase_23 AC 27 ms
23,628 KB
testcase_24 AC 37 ms
24,012 KB
testcase_25 AC 31 ms
23,400 KB
testcase_26 AC 38 ms
24,324 KB
testcase_27 AC 56 ms
23,640 KB
testcase_28 AC 31 ms
23,832 KB
testcase_29 AC 41 ms
23,820 KB
testcase_30 AC 35 ms
23,664 KB
testcase_31 AC 27 ms
23,220 KB
testcase_32 AC 30 ms
24,336 KB
testcase_33 AC 30 ms
23,832 KB
testcase_34 AC 57 ms
23,640 KB
testcase_35 AC 29 ms
23,388 KB
testcase_36 AC 39 ms
23,832 KB
testcase_37 AC 31 ms
24,036 KB
testcase_38 AC 27 ms
23,412 KB
testcase_39 AC 57 ms
24,024 KB
testcase_40 AC 35 ms
23,364 KB
testcase_41 AC 27 ms
23,832 KB
testcase_42 AC 43 ms
23,640 KB
testcase_43 AC 46 ms
24,372 KB
testcase_44 AC 26 ms
24,036 KB
testcase_45 AC 30 ms
24,012 KB
testcase_46 AC 58 ms
24,372 KB
testcase_47 AC 32 ms
23,604 KB
testcase_48 AC 57 ms
23,508 KB
testcase_49 AC 57 ms
23,532 KB
testcase_50 AC 31 ms
23,532 KB
testcase_51 AC 58 ms
24,384 KB
testcase_52 AC 58 ms
24,264 KB
testcase_53 AC 32 ms
23,376 KB
testcase_54 AC 29 ms
23,412 KB
testcase_55 AC 42 ms
23,832 KB
testcase_56 AC 27 ms
24,036 KB
testcase_57 AC 55 ms
23,664 KB
testcase_58 AC 50 ms
23,424 KB
testcase_59 AC 30 ms
23,376 KB
testcase_60 AC 45 ms
24,372 KB
testcase_61 AC 59 ms
23,388 KB
testcase_62 AC 57 ms
23,376 KB
testcase_63 AC 30 ms
24,048 KB
testcase_64 AC 28 ms
24,324 KB
testcase_65 AC 58 ms
24,048 KB
testcase_66 AC 30 ms
24,348 KB
testcase_67 AC 29 ms
23,628 KB
testcase_68 AC 36 ms
23,640 KB
testcase_69 AC 33 ms
23,520 KB
testcase_70 AC 27 ms
24,024 KB
testcase_71 AC 36 ms
23,640 KB
testcase_72 AC 27 ms
24,324 KB
testcase_73 AC 58 ms
24,012 KB
testcase_74 AC 31 ms
23,628 KB
testcase_75 AC 29 ms
24,372 KB
testcase_76 AC 32 ms
24,048 KB
testcase_77 AC 30 ms
23,832 KB
testcase_78 AC 34 ms
24,264 KB
testcase_79 AC 39 ms
23,376 KB
testcase_80 AC 31 ms
23,364 KB
testcase_81 AC 34 ms
23,532 KB
testcase_82 AC 33 ms
23,832 KB
testcase_83 AC 30 ms
24,204 KB
testcase_84 AC 27 ms
24,048 KB
testcase_85 AC 27 ms
23,412 KB
testcase_86 AC 32 ms
23,364 KB
testcase_87 AC 29 ms
23,832 KB
testcase_88 AC 27 ms
24,024 KB
testcase_89 AC 32 ms
24,012 KB
testcase_90 AC 30 ms
23,628 KB
testcase_91 AC 27 ms
23,628 KB
testcase_92 AC 56 ms
23,640 KB
testcase_93 AC 27 ms
24,372 KB
testcase_94 AC 30 ms
24,264 KB
testcase_95 AC 57 ms
23,508 KB
testcase_96 AC 47 ms
23,400 KB
testcase_97 AC 27 ms
23,832 KB
testcase_98 AC 27 ms
23,520 KB
testcase_99 AC 29 ms
23,412 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `t`
  --> Main.rs:89:9
   |
89 |     for t in 1..=MAX_TURN {
   |         ^ help: if this is intentional, prefix it with an underscore: `_t`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: unused variable: `i`
  --> Main.rs:97:13
   |
97 |         for i in 0..n {
   |             ^ help: if this is intentional, prefix it with an underscore: `_i`

warning: unused variable: `h`
  --> Main.rs:99:17
   |
99 |             let h = v[0];
   |                 ^ help: if this is intentional, prefix it with an underscore: `_h`

warning: unused variable: `p`
   --> Main.rs:100:17
    |
100 |             let p = v[1];
    |                 ^ help: if this is intentional, prefix it with an underscore: `_p`

warning: unused variable: `x`
   --> Main.rs:101:17
    |
101 |             let x = v[2];
    |                 ^ help: if this is intentional, prefix it with an underscore: `_x`

warning: constant `HEIGHT` is never used
  --> Main.rs:76:7
   |
76 | const HEIGHT: usize = 60;
   |       ^^^^^^
   |
   = note: `#[warn(dead_code)]` on by default

warning: constant `ENEMY_NUM_MAX` is never used
  --> Main.rs:77:7
   |
77 | const ENEMY_NUM_MAX: usize = 25;
   |       ^^^^^^^^^^^^^

warning: struct `Input` is never constructed
  --> Main.rs:80:8
   |
80 | struct Input {}
   |        ^^^^^

warning: 8 warnings emitted

ソースコード

diff #

#[allow(unused_imports)]
use std::cmp::*;
#[allow(unused_imports)]
use std::collections::*;

#[allow(unused_imports)]
use std::io::Write;
use std::time::SystemTime;

pub struct IO<R, W: std::io::Write>(R, std::io::BufWriter<W>);

impl<R: std::io::Read, W: std::io::Write> IO<R, W> {
    pub fn new(r: R, w: W) -> IO<R, W> {
        IO(r, std::io::BufWriter::new(w))
    }
    pub fn write<S: ToString>(&mut self, s: S) {
        #[allow(unused_imports)]
        use std::io::Write;
        self.1.write(s.to_string().as_bytes()).unwrap();
    }
    pub fn read<T: std::str::FromStr>(&mut self) -> T {
        use std::io::Read;
        let buf = self
            .0
            .by_ref()
            .bytes()
            .map(|b| b.unwrap())
            .skip_while(|&b| b == b' ' || b == b'\n' || b == b'\r' || b == b'\t')
            .take_while(|&b| b != b' ' && b != b'\n' && b != b'\r' && b != b'\t')
            .collect::<Vec<_>>();
        unsafe { std::str::from_utf8_unchecked(&buf) }
            .parse()
            .ok()
            .expect("Parse error.")
    }
    pub fn vec<T: std::str::FromStr>(&mut self, n: usize) -> Vec<T> {
        (0..n).map(|_| self.read()).collect()
    }
    pub fn chars(&mut self) -> Vec<char> {
        self.read::<String>().chars().collect()
    }
}

#[macro_export]
macro_rules! mat {
	($($e:expr),*) => { Vec::from(vec![$($e),*]) };
	($($e:expr,)*) => { Vec::from(vec![$($e),*]) };
	($e:expr; $d:expr) => { Vec::from(vec![$e; $d]) };
	($e:expr; $d:expr $(; $ds:expr)+) => { Vec::from(vec![mat![$e $(; $ds)*]; $d]) };
}

pub trait SetMinMax {
    fn setmin(&mut self, v: Self) -> bool;
    fn setmax(&mut self, v: Self) -> bool;
}
impl<T> SetMinMax for T
where
    T: PartialOrd,
{
    fn setmin(&mut self, v: T) -> bool {
        *self > v && {
            *self = v;
            true
        }
    }
    fn setmax(&mut self, v: T) -> bool {
        *self < v && {
            *self = v;
            true
        }
    }
}

#[allow(dead_code)]
const WIDTH: usize = 25;
const HEIGHT: usize = 60;
const ENEMY_NUM_MAX: usize = 25;
const MAX_TURN: usize = 1_000;

struct Input {}
impl Input {}

fn main() {
    let system_time = SystemTime::now();

    let (r, w) = (std::io::stdin(), std::io::stdout());
    let mut sc = IO::new(r.lock(), w.lock());

    for t in 1..=MAX_TURN {
        let n: isize = sc.read();
        if n == -1 {
            break;
        }

        let n = n as usize;

        for i in 0..n {
            let v = (0..3).map(|_| sc.read::<usize>()).collect::<Vec<_>>();
            let h = v[0];
            let p = v[1];
            let x = v[2];
        }

        let ans = "S";
        println!("{}", ans);
    }

    eprintln!("{}ms", system_time.elapsed().unwrap().as_millis());
}
0