結果
問題 |
No.264 じゃんけん
|
ユーザー |
|
提出日時 | 2022-11-16 23:08:40 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 5,000 ms |
コード長 | 1,025 bytes |
コンパイル時間 | 10,855 ms |
コンパイル使用メモリ | 402,952 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-09-17 17:35:18 |
合計ジャッジ時間 | 11,453 ms |
ジャッジサーバーID (参考情報) |
judge6 / judge3 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 9 |
ソースコード
pub fn getline() -> String { let mut a = String::new(); std::io::stdin().read_line(&mut a).ok(); return a; } fn main() { let x = getline().trim().to_string(); let res = func(x); println!("{}", res); } pub fn func(x: String) -> String{ let v: Vec<&str> = x.split(" ").collect(); let a = v[0].parse::<i32>().unwrap(); let b = v[1].parse::<i32>().unwrap(); if a == 0 { if b == 0 { return "Drew".to_string(); } else if b == 1 { return "Won".to_string(); } else { return "Lost".to_string(); } } else if a == 1 { if b == 0 { return "Lost".to_string(); } else if b == 1 { return "Drew".to_string(); } else { return "Won".to_string(); } } else { if b == 0 { return "Won".to_string(); } else if b == 1 { return "Lost".to_string(); } else { return "Drew".to_string(); } } }