結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー |
![]() |
提出日時 | 2023-07-16 14:19:25 |
言語 | Rust (1.83.0 + proconio) |
結果 |
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 |
純コード判定しない問題か言語 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 100 |
コンパイルメッセージ
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
ソースコード
#[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 TwhereT: 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());}