結果
問題 |
No.486 3 Straight Win(3連勝)
|
ユーザー |
|
提出日時 | 2017-05-22 15:38:47 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 568 bytes |
コンパイル時間 | 14,383 ms |
コンパイル使用メモリ | 393,736 KB |
実行使用メモリ | 6,948 KB |
最終ジャッジ日時 | 2024-06-26 04:27:48 |
合計ジャッジ時間 | 15,585 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
ソースコード
fn hantei(ss: &mut String) -> String { let east = ss.find("OOO"); let west = ss.find("XXX"); (if east.is_none() && west.is_none() { "NA" } else if east.is_none() { "West" } else if west.is_none() { "East" } else if east.unwrap() < west.unwrap() { "East" } else { "West" }).to_string() } fn getline() -> String { let mut s = String::new(); std::io::stdin().read_line(&mut s).ok(); s } fn main() { let mut s = getline(); println!("{}", hantei(&mut s)); }