結果
| 問題 | No.1469 programing |
| コンテスト | |
| ユーザー |
|
| 提出日時 | 2026-01-16 14:16:26 |
| 言語 | Rust (1.92.0 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 31 ms / 3,000 ms |
| コード長 | 402 bytes |
| 記録 | |
| コンパイル時間 | 24,975 ms |
| コンパイル使用メモリ | 412,044 KB |
| 実行使用メモリ | 14,260 KB |
| 最終ジャッジ日時 | 2026-01-16 14:16:58 |
| 合計ジャッジ時間 | 27,031 ms |
|
ジャッジサーバーID (参考情報) |
judge3 / judge2 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 15 |
ソースコード
use proconio::{fastout, input, marker::Bytes};
#[fastout]
fn main() {
input! {
s: Bytes,
}
println!("{}", output(solve(s)))
}
fn solve(s: Vec<u8>) -> Vec<u8> {
let mut ans = vec![s[0]];
s.windows(2).for_each(|s| {
if s[0] != s[1] {
ans.push(s[1]);
}
});
ans
}
fn output(ans: Vec<u8>) -> String {
String::from_utf8(ans).unwrap()
}