結果
問題 | No.5017 Tool-assisted Shooting |
ユーザー |
|
提出日時 | 2023-07-16 15:40:31 |
言語 | Rust (1.83.0 + proconio) |
結果 |
RE
|
実行時間 | - |
コード長 | 2,121 bytes |
コンパイル時間 | 705 ms |
コンパイル使用メモリ | 147,052 KB |
実行使用メモリ | 24,504 KB |
スコア | 74,830 |
平均クエリ数 | 399.74 |
最終ジャッジ日時 | 2023-07-16 15:40:41 |
合計ジャッジ時間 | 9,314 ms |
ジャッジサーバーID (参考情報) |
judge11 / judge12 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 18 RE * 82 |
コンパイルメッセージ
warning: unused macro definition: `input` --> Main.rs:2:14 | 2 | macro_rules! input { | ^^^^^ | = note: `#[warn(unused_macros)]` on by default warning: unused macro definition: `input_inner` --> Main.rs:19:14 | 19 | macro_rules! input_inner { | ^^^^^^^^^^^ warning: unused macro definition: `read_value` --> Main.rs:29:14 | 29 | macro_rules! read_value { | ^^^^^^^^^^ warning: unused variable: `input` --> Main.rs:55:21 | 55 | if let Some(input) = read_input() { | ^^^^^ help: if this is intentional, prefix it with an underscore: `_input` | = note: `#[warn(unused_variables)]` on by default warning: type alias `Output` is never used --> Main.rs:51:6 | 51 | type Output = Vec<char>; | ^^^^^^ | = note: `#[warn(dead_code)]` on by default warning: fields `n` and `es` are never read --> Main.rs:84:5 | 83 | struct Input { | ----- fields in this struct 84 | n: usize, | ^ 85 | es: Vec<(usize, usize, usize)>, | ^^ | = note: `Input` has a derived impl for the trait `Debug`, but this is intentionally ignored during dead code analysis warning: 6 warnings emitted
ソースコード
// https://qiita.com/tanakh/items/0ba42c7ca36cd29d0ac8macro_rules! input {(source = $s:expr, $($r:tt)*) => {let mut iter = $s.split_whitespace();input_inner!{iter, $($r)*}};($($r:tt)*) => {let s = {use std::io::Read;let mut s = String::new();std::io::stdin().read_to_string(&mut s).unwrap();s};let mut iter = s.split_whitespace();input_inner!{iter, $($r)*}};}macro_rules! input_inner {($iter:expr) => {};($iter:expr, ) => {};($iter:expr, $var:ident : $t:tt $($r:tt)*) => {let $var = read_value!($iter, $t);input_inner!{$iter $($r)*}};}macro_rules! read_value {($iter:expr, ( $($t:tt),* )) => {( $(read_value!($iter, $t)),* )};($iter:expr, [ $t:tt ; $len:expr ]) => {(0..$len).map(|_| read_value!($iter, $t)).collect::<Vec<_>>()};($iter:expr, chars) => {read_value!($iter, String).chars().collect::<Vec<char>>()};($iter:expr, usize1) => {read_value!($iter, usize) - 1};($iter:expr, $t:ty) => {$iter.next().unwrap().parse::<$t>().expect("Parse error")};}type Output = Vec<char>;fn main() {for _ in 0..1000 {if let Some(input) = read_input() {println!("S");}}}fn read_input() -> Option<Input> {let mut n = String::new();std::io::stdin().read_line(&mut n).unwrap();if n == "-1" {return None;}let n = n.trim().parse::<usize>().unwrap();let mut es = vec![];for _ in 0..n {let mut line = String::new();std::io::stdin().read_line(&mut line).unwrap();let mut tokens = line.split_whitespace();let h = tokens.next().unwrap().parse::<usize>().unwrap();let p = tokens.next().unwrap().parse::<usize>().unwrap();let x = tokens.next().unwrap().parse::<usize>().unwrap();es.push((h, p, x));}Some(Input { n, es })}#[derive(Debug)]struct Input {n: usize,es: Vec<(usize, usize, usize)>,}