run_length_encoding
関数 · 文字列ユーティリティ
template <class Container>
auto run_length_encoding(const Container &v);
概要
ランレングス圧縮
“aaabbc” → {(a,3),(b,2),(c,1)}
計算量
- $O(n)$
関連項目
longest_common_prefix— 最長共通接頭辞 (longest common prefix)longest_common_suffix— 最長共通接尾辞 (longest common suffix)minimum_period—sを隙間なく敷き詰める最小の周期を求める(sの長さを割り切る最小の $i$)is_palindrome— 回文判定is_palindromic_number— 回文数判定is_correct_parenthesis_sequences— 正しい括弧列か判定longest_increasing_subsequence— 最長増加部分列の長さmake_lis— 最長増加部分列を構成する添字列split— 文字列を区切り文字で分割するjoin— 文字列を区切り文字で連結するnext_string— 辞書順で次の順列(文字列版、std::next_permutation のラッパ)to_lower— 全文字を小文字に変換した文字列を返すto_upper— 全文字を大文字に変換した文字列を返す