結果

問題 No.5017 Tool-assisted Shooting
ユーザー ntk-ta01
提出日時 2023-07-16 16:33:50
言語 Rust
(1.83.0 + proconio)
結果
RE  
実行時間 -
コード長 1,025 bytes
コンパイル時間 1,154 ms
コンパイル使用メモリ 142,528 KB
実行使用メモリ 24,468 KB
スコア 74,830
平均クエリ数 399.74
最終ジャッジ日時 2023-07-16 16:34:01
合計ジャッジ時間 10,590 ms
ジャッジサーバーID
(参考情報)
judge12 / judge17
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 18 RE * 82
権限があれば一括ダウンロードができます

ソースコード

diff #

// type Output = Vec<char>;

use std::io::{stdout, Write};

fn main() {
    for _ in 0..1000 {
        if let Some(_input) = read_input() {
            println!("S");
            stdout().flush().unwrap();
        } else {
            break;
        }
    }
}

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

#[allow(dead_code)]
#[derive(Debug)]
struct Input {
    n: usize,
    es: Vec<(usize, usize, usize)>,
}
0