結果

問題 No.264 じゃんけん
コンテスト
ユーザー Tiramister
提出日時 2018-09-02 17:33:17
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 5,000 ms
コード長 675 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,983 ms
コンパイル使用メモリ 187,072 KB
実行使用メモリ 6,400 KB
最終ジャッジ日時 2026-04-18 04:06:41
合計ジャッジ時間 5,568 ms
ジャッジサーバーID
(参考情報)
judge1_1 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 9
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

use std::io::*;
use std::str::FromStr;

#[allow(dead_code)]
fn get_line() -> String {
    let stdin = stdin();
    let mut line = String::new();
    stdin.lock().read_line(&mut line).expect("io error.");
    line.trim().to_string()
}

#[allow(dead_code)]
fn cast<T: FromStr>(s: &str) -> T {
    s.parse().ok().expect("parse error.")
}

#[allow(dead_code)]
fn get_vec<T: FromStr>() -> Vec<T> {
    (&get_line()).split(' ').map(cast::<T>).collect()
}

fn main() {
    let v: Vec<u64> = get_vec();
    println!("{}",
        if v[0] == v[1] {
            "Drew"
        } else if (v[0] + 1) % 3 == v[1] {
            "Won"
        } else {
            "Lost"
        }
    );
}
0