結果
問題 |
No.514 宝探し3
|
ユーザー |
![]() |
提出日時 | 2017-08-28 09:10:43 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 32 ms / 2,000 ms |
コード長 | 577 bytes |
コンパイル時間 | 11,790 ms |
コンパイル使用メモリ | 386,052 KB |
実行使用メモリ | 25,220 KB |
平均クエリ数 | 2.75 |
最終ジャッジ日時 | 2024-07-16 14:04:40 |
合計ジャッジ時間 | 13,089 ms |
ジャッジサーバーID (参考情報) |
judge3 / judge4 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 12 |
コンパイルメッセージ
warning: variable does not need to be mutable --> src/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 --> src/main.rs:8:9 | 8 | let mut y:i32 = read(); | ----^ | | | help: remove this `mut`
ソースコード
use std::io::*; use std::str::*; fn main() { println!("{} {}",0,0); let mut x:i32 = read(); if x == 0{return;}else{ println!("{} {}",0,x); let mut y:i32 = read(); if y == 0{return;}else{ 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)) }