結果

問題 No.3655 Adjacent Pairs in Triplets
コンテスト
ユーザー QiToY
提出日時 2026-08-30 13:37:46
言語 Rust
(1.97.1 + proconio + num + itertools)
コンパイル:
/usr/bin/rustc_custom
実行:
./target/release/main
結果
AC  
実行時間 1 ms / 2,000 ms
+ 959µs
コード長 899 bytes
記録
記録タグの例:
初AC ショートコード 純ショートコード 純主流ショートコード 最速実行時間
コンパイル時間 7,236 ms
コンパイル使用メモリ 181,736 KB
実行使用メモリ 6,272 KB
最終ジャッジ日時 2026-08-30 13:38:53
合計ジャッジ時間 3,979 ms
ジャッジサーバーID
(参考情報)
judge3_0 / judge2_0
このコードへのチャレンジ
(要ログイン)
ファイルパターン 結果
sample AC * 3
other AC * 18
権限があれば一括ダウンロードができます

ソースコード

diff #
raw source code

#![allow(unused_imports)]

fn main() {
    input! {
        s: Chars
    }
    println!("{}", s.windows(3).filter(|s| (s[0] == s[1]) ^ (s[1] == s[2])).count());
}

use proconio::{input, marker::*};
use itertools::{iproduct, izip, Itertools as _};
use std::{cmp::Reverse, collections::*};

#[macro_export]
macro_rules! chmax {
    ($a:expr, $b:expr) => {{
        let tmp = $b;
        if $a < tmp {
            $a = tmp;
            true
        } else {
            false
        }
    }};
}

#[macro_export]
macro_rules! chmin {
    ($a:expr, $b:expr) => {{
        let tmp = $b;
        if $a > tmp {
            $a = tmp;
            true
        } else {
            false
        }
    }};
}

#[macro_export]
/// mvec![]
macro_rules! mvec {
    ($val:expr; ()) => {
        $val
    };
    ($val:expr; ($size:expr $(,$rest:expr)*)) => {
        vec![mvec![$val; ($($rest),*)]; $size]
    };
}
0