結果
| 問題 | No.3655 Adjacent Pairs in Triplets |
| コンテスト | |
| ユーザー |
manabeai
|
| 提出日時 | 2026-08-30 13:43:52 |
| 言語 | Rust (1.97.1 + proconio + num + itertools) |
| 結果 |
AC
|
| 実行時間 | 8 ms / 2,000 ms |
| + 733µs | |
| コード長 | 612 bytes |
| 記録 | |
| コンパイル時間 | 1,193 ms |
| コンパイル使用メモリ | 189,888 KB |
| 実行使用メモリ | 6,272 KB |
| 最終ジャッジ日時 | 2026-08-30 13:44:13 |
| 合計ジャッジ時間 | 2,535 ms |
|
ジャッジサーバーID (参考情報) |
judge3_0 / judge2_0 |
(要ログイン)
| ファイルパターン | 結果 |
|---|---|
| sample | AC * 3 |
| other | AC * 18 |
ソースコード
#![allow(
non_snake_case,
unused_variables,
unused_assignments,
unused_mut,
unused_imports,
unused_macros,
dead_code
)]
// use ac_library::*;
use itertools::Itertools;
// use nalgebra::coordinates::X;
use proconio::{derive_readable, input, marker::*};
use std::{cmp::*, collections::*, fmt::*, hash::*, marker::PhantomData, ops::*, println};
// use rustc_hash::*;
fn main() {
input! {
S: Chars
}
println!(
"{}",
S.windows(3)
.filter(|x| (x[0] == x[1] || x[1] == x[2]) && x.iter().unique().count() == 2)
.count()
);
}
manabeai