結果
問題 | No.908 うしたぷにきあくん文字列 |
ユーザー |
|
提出日時 | 2020-01-05 21:13:30 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 2 ms / 2,000 ms |
コード長 | 462 bytes |
コンパイル時間 | 14,244 ms |
コンパイル使用メモリ | 381,068 KB |
実行使用メモリ | 6,820 KB |
最終ジャッジ日時 | 2024-11-22 23:30:42 |
合計ジャッジ時間 | 13,693 ms |
ジャッジサーバーID (参考情報) |
judge1 / judge2 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 2 |
other | AC * 18 |
ソースコード
use std::io::Read; fn solve(s: &str) { let not_ushitap: bool = s.chars().enumerate() .any(|(i, c)| !(i % 2 == 0 && c.is_alphabetic()) && !(i % 2 == 1 && c.is_ascii_whitespace())); if not_ushitap { println!("{}", "No"); } else { println!("{}", "Yes"); } } fn main() { let mut s = String::new(); std::io::stdin().read_to_string(&mut s).ok(); let s = s.trim().split('\n').next().unwrap().trim(); solve(s); }