結果

問題 No.514 宝探し3
ユーザー uenokuuenoku
提出日時 2017-08-28 09:06:44
言語 Rust
(1.77.0)
結果
RE  
実行時間 -
コード長 520 bytes
コンパイル時間 1,934 ms
コンパイル使用メモリ 146,168 KB
実行使用メモリ 24,360 KB
平均クエリ数 2.92
最終ジャッジ日時 2023-09-23 14:24:36
合計ジャッジ時間 3,299 ms
ジャッジサーバーID
(参考情報)
judge15 / judge11
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 26 ms
23,352 KB
testcase_01 AC 24 ms
23,772 KB
testcase_02 AC 24 ms
23,484 KB
testcase_03 AC 24 ms
23,556 KB
testcase_04 AC 24 ms
23,436 KB
testcase_05 AC 24 ms
24,156 KB
testcase_06 AC 24 ms
24,360 KB
testcase_07 AC 24 ms
24,036 KB
testcase_08 RE -
testcase_09 AC 24 ms
24,072 KB
testcase_10 AC 24 ms
23,676 KB
testcase_11 AC 24 ms
23,328 KB
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: variable does not need to be mutable
 --> Main.rs:5:9
  |
5 |     let mut x:i32 = read();
  |         ----^
  |         |
  |         help: remove this `mut`
  |
  = note: `#[warn(unused_mut)]` on by default

warning: variable does not need to be mutable
 --> Main.rs:7:9
  |
7 |     let mut y:i32 = read();
  |         ----^
  |         |
  |         help: remove this `mut`

warning: 2 warnings emitted

ソースコード

diff #

use std::io::*;
use std::str::*;
fn main() {
    println!("{} {}",0,0);
    let mut x:i32 = read();
    println!("{} {}",0,x);
    let mut y:i32 = read();
    println!("{} {}",y/2,x-y/2);
}

fn read<T: FromStr>() -> T {
    let stdin = stdin();
    let stdin = stdin.lock();
    let s = stdin.bytes().map(|c| c.unwrap() as char)
        .skip_while(|c| c.is_whitespace())
        .take_while(|c| !c.is_whitespace())
        .collect::<String>();
    s.parse::<T>().unwrap_or_else(|_| panic!("Faild to parse {}", s))
}


0