結果
| 問題 |
No.908 うしたぷにきあくん文字列
|
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2019-11-26 11:25:27 |
| 言語 | Rust (1.83.0 + proconio) |
| 結果 |
AC
|
| 実行時間 | 1 ms / 2,000 ms |
| コード長 | 403 bytes |
| コンパイル時間 | 13,009 ms |
| コンパイル使用メモリ | 380,068 KB |
| 実行使用メモリ | 6,820 KB |
| 最終ジャッジ日時 | 2024-11-06 14:16:45 |
| 合計ジャッジ時間 | 13,606 ms |
|
ジャッジサーバーID (参考情報) |
judge4 / judge3 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 2 |
| other | AC * 18 |
コンパイルメッセージ
warning: use of deprecated method `core::str::<impl str>::trim_right`: superseded by `trim_end` --> src/main.rs:4:16 | 4 | let ts = s.trim_right().to_owned(); | ^^^^^^^^^^ | = note: `#[warn(deprecated)]` on by default help: replace the use of the deprecated method | 4 | let ts = s.trim_end().to_owned(); | ~~~~~~~~
ソースコード
fn main(){
let mut s = String::new();
std::io::stdin().read_line(&mut s).unwrap();
let ts = s.trim_right().to_owned();
let mut is_even = false;
for c in ts.chars() {
if (is_even && c != ' ') ||
(!is_even && c == ' ') {
println!("No");
return;
} else {
is_even = !is_even;
}
}
println!("Yes");
}