結果
問題 | No.1469 programing |
ユーザー |
![]() |
提出日時 | 2021-04-09 21:29:41 |
言語 | Rust (1.83.0 + proconio) |
結果 |
AC
|
実行時間 | 166 ms / 3,000 ms |
コード長 | 890 bytes |
コンパイル時間 | 15,107 ms |
コンパイル使用メモリ | 396,500 KB |
実行使用メモリ | 11,648 KB |
最終ジャッジ日時 | 2024-06-25 04:13:06 |
合計ジャッジ時間 | 15,198 ms |
ジャッジサーバーID (参考情報) |
judge2 / judge1 |
(要ログイン)
ファイルパターン | 結果 |
---|---|
sample | AC * 3 |
other | AC * 15 |
ソースコード
fn run<'a, I: Iterator<Item = &'a str>>(mut scanner: I) { macro_rules! scan { ([$t:tt; $n:expr]) => ((0..$n).map(|_| scan!($t)).collect::<Vec<_>>()); (($($t:tt),*)) => (($(scan!($t)),*)); ([$($t:tt),*]) => ([$(scan!($t)),*]); (Usize1) => (scan!(usize) - 1); (Bytes) => (scan!(String).into_bytes()); ($t:ty) => (scanner.next().unwrap().parse::<$t>().unwrap()); } macro_rules! input { ($($($v:ident)* : $t:tt),* $(,)?) => ($(let $($v)* = scan!($t);)*); } input! { s: Bytes, } let mut p = 0; for b in s { if b != p { print!("{}", b as char); p = b; } } println!(); } fn main() { let ref mut buf = Vec::new(); std::io::Read::read_to_end(&mut std::io::stdin(), buf).ok(); run(std::str::from_utf8(buf).unwrap().split_whitespace()); }