結果
| 問題 |
No.264 じゃんけん
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2022-11-16 23:07:09 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
RE
|
| 実行時間 | - |
| コード長 | 1,006 bytes |
| コンパイル時間 | 10,645 ms |
| コンパイル使用メモリ | 401,156 KB |
| 実行使用メモリ | 6,948 KB |
| 最終ジャッジ日時 | 2024-09-17 17:33:51 |
| 合計ジャッジ時間 | 11,376 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| other | RE * 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();
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();
}
}
}