結果
問題 | No.1016 三目並べ |
ユーザー |
|
提出日時 | 2023-01-20 23:37:28 |
言語 | Rust (1.83.0 + proconio) |
結果 |
WA
|
実行時間 | - |
コード長 | 721 bytes |
コンパイル時間 | 13,774 ms |
コンパイル使用メモリ | 403,580 KB |
実行使用メモリ | 6,944 KB |
最終ジャッジ日時 | 2024-06-23 11:34:31 |
合計ジャッジ時間 | 14,278 ms |
ジャッジサーバーID (参考情報) |
judge4 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 1 |
other | WA * 10 |
コンパイルメッセージ
warning: unused variable: `n` --> src/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
ソースコード
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); } }