結果

問題 No.5017 Tool-assisted Shooting
ユーザー tamura-uptamura-up
提出日時 2023-07-21 04:33:01
言語 Rust
(1.77.0)
結果
AC  
実行時間 67 ms / 2,000 ms
コード長 2,471 bytes
コンパイル時間 2,068 ms
コンパイル使用メモリ 146,120 KB
実行使用メモリ 24,372 KB
スコア 74,830
平均クエリ数 399.74
最終ジャッジ日時 2023-07-21 04:33:16
合計ジャッジ時間 11,841 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
純コード判定しない問題か言語
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 34 ms
24,324 KB
testcase_01 AC 63 ms
24,372 KB
testcase_02 AC 32 ms
24,288 KB
testcase_03 AC 31 ms
23,436 KB
testcase_04 AC 41 ms
23,688 KB
testcase_05 AC 40 ms
23,568 KB
testcase_06 AC 31 ms
24,000 KB
testcase_07 AC 42 ms
23,592 KB
testcase_08 AC 33 ms
24,324 KB
testcase_09 AC 36 ms
24,336 KB
testcase_10 AC 41 ms
23,640 KB
testcase_11 AC 34 ms
24,372 KB
testcase_12 AC 31 ms
24,000 KB
testcase_13 AC 36 ms
23,424 KB
testcase_14 AC 35 ms
24,228 KB
testcase_15 AC 34 ms
24,348 KB
testcase_16 AC 31 ms
23,580 KB
testcase_17 AC 62 ms
23,892 KB
testcase_18 AC 62 ms
23,928 KB
testcase_19 AC 35 ms
24,096 KB
testcase_20 AC 39 ms
23,628 KB
testcase_21 AC 37 ms
23,700 KB
testcase_22 AC 41 ms
23,868 KB
testcase_23 AC 31 ms
24,312 KB
testcase_24 AC 40 ms
23,604 KB
testcase_25 AC 34 ms
23,868 KB
testcase_26 AC 42 ms
24,012 KB
testcase_27 AC 60 ms
24,300 KB
testcase_28 AC 36 ms
23,604 KB
testcase_29 AC 35 ms
24,072 KB
testcase_30 AC 41 ms
23,904 KB
testcase_31 AC 31 ms
23,460 KB
testcase_32 AC 35 ms
23,424 KB
testcase_33 AC 36 ms
23,604 KB
testcase_34 AC 63 ms
24,288 KB
testcase_35 AC 34 ms
23,988 KB
testcase_36 AC 43 ms
24,096 KB
testcase_37 AC 36 ms
23,580 KB
testcase_38 AC 31 ms
23,532 KB
testcase_39 AC 63 ms
24,324 KB
testcase_40 AC 39 ms
23,532 KB
testcase_41 AC 32 ms
23,400 KB
testcase_42 AC 50 ms
23,412 KB
testcase_43 AC 55 ms
24,300 KB
testcase_44 AC 33 ms
23,376 KB
testcase_45 AC 36 ms
24,072 KB
testcase_46 AC 67 ms
23,520 KB
testcase_47 AC 41 ms
24,276 KB
testcase_48 AC 63 ms
23,424 KB
testcase_49 AC 62 ms
23,376 KB
testcase_50 AC 35 ms
23,688 KB
testcase_51 AC 61 ms
24,324 KB
testcase_52 AC 63 ms
23,544 KB
testcase_53 AC 37 ms
23,652 KB
testcase_54 AC 33 ms
23,412 KB
testcase_55 AC 46 ms
23,820 KB
testcase_56 AC 33 ms
23,616 KB
testcase_57 AC 62 ms
23,700 KB
testcase_58 AC 54 ms
23,448 KB
testcase_59 AC 33 ms
24,348 KB
testcase_60 AC 52 ms
24,060 KB
testcase_61 AC 63 ms
23,532 KB
testcase_62 AC 64 ms
24,348 KB
testcase_63 AC 34 ms
23,448 KB
testcase_64 AC 32 ms
23,376 KB
testcase_65 AC 64 ms
23,376 KB
testcase_66 AC 34 ms
23,580 KB
testcase_67 AC 35 ms
23,520 KB
testcase_68 AC 39 ms
23,700 KB
testcase_69 AC 37 ms
23,544 KB
testcase_70 AC 33 ms
24,336 KB
testcase_71 AC 41 ms
23,652 KB
testcase_72 AC 34 ms
24,072 KB
testcase_73 AC 63 ms
23,628 KB
testcase_74 AC 35 ms
23,592 KB
testcase_75 AC 34 ms
23,640 KB
testcase_76 AC 36 ms
23,532 KB
testcase_77 AC 36 ms
23,580 KB
testcase_78 AC 36 ms
23,436 KB
testcase_79 AC 45 ms
24,312 KB
testcase_80 AC 35 ms
23,532 KB
testcase_81 AC 39 ms
23,460 KB
testcase_82 AC 37 ms
24,348 KB
testcase_83 AC 35 ms
24,000 KB
testcase_84 AC 32 ms
23,580 KB
testcase_85 AC 32 ms
23,532 KB
testcase_86 AC 36 ms
23,688 KB
testcase_87 AC 33 ms
23,412 KB
testcase_88 AC 31 ms
23,880 KB
testcase_89 AC 38 ms
24,192 KB
testcase_90 AC 36 ms
23,688 KB
testcase_91 AC 31 ms
23,652 KB
testcase_92 AC 62 ms
23,460 KB
testcase_93 AC 31 ms
24,240 KB
testcase_94 AC 35 ms
24,300 KB
testcase_95 AC 66 ms
23,712 KB
testcase_96 AC 53 ms
23,388 KB
testcase_97 AC 34 ms
23,604 KB
testcase_98 AC 31 ms
23,412 KB
testcase_99 AC 33 ms
23,424 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `enemies`
  --> Main.rs:78:20
   |
78 |     while let Some(enemies)=read_input(){
   |                    ^^^^^^^ help: if this is intentional, prefix it with an underscore: `_enemies`
   |
   = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

ソースコード

diff #

#![allow(unused_imports)]
#![allow(unused_macros)]
#![allow(dead_code)]
#![allow(non_snake_case)]

use std::fs::read;
use std::io::Write;
use std::time::Instant;

const Y: usize = 60;

// src: https://yukicoder.me/submissions/892593
//
// let x = get!(i32); // 1行の i32 の入力を受け取る
// let x = get!(i32;2); // 2行の i32 の入力を受け取る
//
// tuple
// let x = get!(i32,i32,i32); // (i32, i32, i32 )のタプルを受け取る
// let x = get!(i32,i32,i32;2); // 2行 (i32, i32, i32 )のタプルを受け取る
macro_rules! get {
      ($t:ty) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.trim().parse::<$t>().unwrap()
          }
      };
      ($($t:ty),*) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              let mut iter = line.split_whitespace();
              (
                  $(iter.next().unwrap().parse::<$t>().unwrap(),)*
              )
          }
      };
      ($t:ty; $n:expr) => {
          (0..$n).map(|_|
              get!($t)
          ).collect::<Vec<_>>()
      };
      ($($t:ty),*; $n:expr) => {
          (0..$n).map(|_|
              get!($($t),*)
          ).collect::<Vec<_>>()
      };
      ($t:ty ;;) => {
          {
              let mut line: String = String::new();
              std::io::stdin().read_line(&mut line).unwrap();
              line.split_whitespace()
                  .map(|t| t.parse::<$t>().unwrap())
                  .collect::<Vec<_>>()
          }
      };
      ($t:ty ;; $n:expr) => {
          (0..$n).map(|_| get!($t ;;)).collect::<Vec<_>>()
      };
}


fn read_input() -> Option<Vec<(u32, u32, usize)>> {
    let n=get!(i32);
    if n < 0{
        return None;
    }
    let mut enemies=vec![];
    for _ in 0..n{
        enemies.push(get!(u32,u32,usize));
    }

    Some(enemies)
}

fn main() {
    let mut iter=0;
    while let Some(enemies)=read_input(){
        iter+=1;
        println!("S");
        std::io::stdout().flush().unwrap();
        if iter>=1000{break;}
    }
}

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 } }
}
0