結果

問題 No.1016 三目並べ
ユーザー phsplsphspls
提出日時 2023-01-20 23:37:28
言語 Rust
(1.77.0)
結果
WA  
実行時間 -
コード長 721 bytes
コンパイル時間 2,406 ms
コンパイル使用メモリ 148,548 KB
実行使用メモリ 4,380 KB
最終ジャッジ日時 2023-09-05 16:03:22
合計ジャッジ時間 2,135 ms
ジャッジサーバーID
(参考情報)
judge11 / judge14
このコードへのチャレンジ
(要ログイン)

テストケース

テストケース表示
入力 結果 実行時間
実行使用メモリ
testcase_00 AC 1 ms
4,380 KB
testcase_01 WA -
testcase_02 WA -
testcase_03 WA -
testcase_04 WA -
testcase_05 WA -
testcase_06 WA -
testcase_07 WA -
testcase_08 WA -
testcase_09 WA -
testcase_10 WA -
権限があれば一括ダウンロードができます
コンパイルメッセージ
warning: unused variable: `n`
 --> Main.rs:6:9
  |
6 |     let n = temp[0].parse::<usize>().unwrap();
  |         ^ help: if this is intentional, prefix it with an underscore: `_n`
  |
  = note: `#[warn(unused_variables)]` on by default

warning: 1 warning emitted

ソースコード

diff #

fn solve() -> String {
    let mut temp = String::new();
    std::io::stdin().read_line(&mut temp).ok();
    let temp: Vec<&str> = temp.trim().split_whitespace().collect();
    let n = temp[0].parse::<usize>().unwrap();
    let s = temp[1];
    if s.contains("ooo") || s.contains("o-o") || s.contains("-oo") || s.contains("oo-") || s.contains("o---o") {
        return "O".to_string();
    }
    return "X".to_string();
}

fn main() {
    let mut t = String::new();
    std::io::stdin().read_line(&mut t).ok();
    let t: usize = t.trim().parse().unwrap();
    let mut result = Vec::with_capacity(t);
    for _ in 0..t {
        result.push(solve());
    }
    for v in result.iter() {
        println!("{}", v);
    }
}
0