結果

問題 No.46 はじめのn歩
コンテスト
ユーザー halship
提出日時 2020-10-19 22:17:17
言語 Rust
(1.97.1 + proconio + num + itertools + ACL)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 0 ms / 5,000 ms
+ 886µs
コード長 615 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 9,470 ms
コンパイル使用メモリ 182,648 KB
実行使用メモリ 5,888 KB
最終ジャッジ日時 2026-08-21 10:02:51
合計ジャッジ時間 5,874 ms
ジャッジサーバーID
(参考情報)
judge2_1 / judge1_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 10
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::{self, BufRead, BufReader, BufWriter, Write};

fn main() {
    let stdin = io::stdin();
    let mut stdin = BufReader::new(stdin.lock());
    let stdout = io::stdout();
    let mut stdout = BufWriter::new(stdout.lock());

    let x: Vec<u32> = read_line(&mut stdin)
        .split_whitespace()
        .take(2)
        .filter_map(|s| s.parse().ok())
        .collect();
    let result = (x[1] - 1) / x[0] + 1;

    writeln!(&mut stdout, "{}", result).unwrap();
}

fn read_line<R: BufRead>(reader: &mut R) -> String {
    let mut buf = String::new();
    reader.read_line(&mut buf).unwrap();
    buf
}
0