結果
問題 | No.486 3 Straight Win(3連勝) |
ユーザー |
|
提出日時 | 2017-03-27 01:38:11 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 1 ms / 2,000 ms |
コード長 | 481 bytes |
コンパイル時間 | 13,067 ms |
コンパイル使用メモリ | 394,160 KB |
実行使用メモリ | 5,376 KB |
最終ジャッジ日時 | 2024-06-26 04:24:29 |
合計ジャッジ時間 | 14,263 ms |
ジャッジサーバーID (参考情報) |
judge5 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
other | AC * 28 |
コンパイルメッセージ
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); | +++++++
ソースコード
fn main() {let mut line = String::new();std::io::stdin().read_line(&mut line);let mut now = '_';let mut len = 0;for i in line.chars() {if now != i {now = i;len = 0;}len += 1;if len == 3 {match i {'O' => println!("East"),'X' => println!("West"),_ => panic!(),}return;}}println!("NA");}