結果

問題 No.5018 Let's Make a Best-seller Book
ユーザー rhoo
提出日時 2023-10-01 16:18:57
言語 Rust
(1.83.0 + proconio)
結果
TLE  
実行時間 -
コード長 678 bytes
コンパイル時間 540 ms
コンパイル使用メモリ 142,852 KB
実行使用メモリ 4,380 KB
スコア 0
最終ジャッジ日時 2023-10-01 16:19:02
合計ジャッジ時間 4,516 ms
ジャッジサーバーID
(参考情報)
judge11 / judge13
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other TLE * 1 -- * 99
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused imports: `BufWriter`, `Write`, `stdout`
 --> Main.rs:2:22
  |
2 | use std::io::{stdin, stdout, BufWriter, Write};
  |                      ^^^^^^  ^^^^^^^^^  ^^^^^
  |
  = note: `#[warn(unused_imports)]` on by default

warning: unused variable: `T`
 --> Main.rs:6:9
  |
6 |     let T:usize=scan.next();
  |         ^ help: if this is intentional, prefix it with an underscore: `_T`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: 2 warnings emitted

ソースコード

diff #

#![allow(unused_must_use, non_snake_case)]
use std::io::{stdin, stdout, BufWriter, Write};

fn main() {
    let mut scan = Scanner::default();
    let T:usize=scan.next();
    panic!();
}

#[derive(Default)]
struct Scanner {
    buffer: Vec<String>,
}
impl Scanner {
    fn next<T: std::str::FromStr>(&mut self) -> T {
        loop {
            if let Some(token) = self.buffer.pop() {
                return token.parse().ok().expect("Failed parse");
            }
            let mut input = String::new();
            stdin().read_line(&mut input).expect("Failed read");
            self.buffer = input.split_whitespace().rev().map(String::from).collect();
        }
    }
}
0