結果

問題 No.486 3 Straight Win(3連勝)
コンテスト
ユーザー hebiyan
提出日時 2017-05-22 15:38:47
言語 Rust
(1.94.0 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
コード長 568 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 2,853 ms
コンパイル使用メモリ 190,104 KB
実行使用メモリ 7,720 KB
最終ジャッジ日時 2026-03-12 18:04:08
合計ジャッジ時間 2,578 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge1_1
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 28
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

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));
}
0