結果

問題 No.486 3 Straight Win(3連勝)
ユーザー packet0
提出日時 2017-03-27 01:33:08
言語 Rust
(1.83.0 + proconio)
結果
WA  
実行時間 -
コード長 443 bytes
コンパイル時間 12,070 ms
コンパイル使用メモリ 378,132 KB
実行使用メモリ 5,376 KB
最終ジャッジ日時 2024-07-06 06:37:33
合計ジャッジ時間 10,985 ms
ジャッジサーバーID
(参考情報)
judge4 / judge5
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
other AC * 19 WA * 9
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused `Result` that must be used
 --> src/main.rs:3:5
  |
3 |     std::io::stdin().read_line(&mut line);
  |     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  |
  = note: this `Result` may be an `Err` variant, which should be handled
  = note: `#[warn(unused_must_use)]` on by default
help: use `let _ = ...` to ignore the resulting value
  |
3 |     let _ = std::io::stdin().read_line(&mut line);
  |     +++++++

ソースコード

diff #

fn main() {
    let mut line = String::new();
    std::io::stdin().read_line(&mut line);
    let (mut e, mut w) = (0, 0);
    for i in line.chars() {
        match i {
            'O' => e += 1,
            'X' => w += 1,
            _ => break,
        }
        if e == 3 {
            println!("East");
            return;
        }
        if w == 3 {
            println!("West");
            return;
        }
    }
    println!("NA");
}
0