{"problem":{"name":"C. K-Dominant Character","description":{"content":"You are given a string _s_ consisting of lowercase Latin letters. Character _c_ is called _k_\\-dominant iff each substring of _s_ with length at least _k_ contains this character _c_. You have to fin","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":2000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF888C"},"statements":[{"statement_type":"Markdown","content":"You are given a string _s_ consisting of lowercase Latin letters. Character _c_ is called _k_\\-dominant iff each substring of _s_ with length at least _k_ contains this character _c_.\n\nYou have to find minimum _k_ such that there exists at least one _k_\\-dominant character.\n\n## Input\n\nThe first line contains string _s_ consisting of lowercase Latin letters (1 ≤ |_s_| ≤ 100000).\n\n## Output\n\nPrint one number — the minimum value of _k_ such that there exists at least one _k_\\-dominant character.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"给定一个由小写拉丁字母组成的字符串 #cf_span[s]。字符 #cf_span[c] 被称为 #cf_span[k]-主导的，当且仅当 #cf_span[s] 的每个长度至少为 #cf_span[k] 的子串都包含该字符 #cf_span[c]。\n\n你需要找到最小的 #cf_span[k]，使得存在至少一个 #cf_span[k]-主导的字符。\n\n第一行包含一个由小写拉丁字母组成的字符串 #cf_span[s]（#cf_span[1 ≤ |s| ≤ 100000]）。\n\n请输出一个数字——存在至少一个 #cf_span[k]-主导字符的最小 #cf_span[k] 值。\n\n## Input\n\n第一行包含一个由小写拉丁字母组成的字符串 #cf_span[s]（#cf_span[1 ≤ |s| ≤ 100000]）。\n\n## Output\n\n请输出一个数字——存在至少一个 #cf_span[k]-主导字符的最小 #cf_span[k] 值。\n\n[samples]","is_translate":true,"language":"Chinese"},{"statement_type":"Markdown","content":"Let $ s $ be a string of length $ n \\geq 1 $ over the alphabet $ \\Sigma = \\{a, b, \\dots, z\\} $.\n\nFor a character $ c \\in \\Sigma $ and an integer $ k \\geq 1 $, define $ c $ to be **$ k $-dominant** if every contiguous substring of $ s $ of length $ \\geq k $ contains at least one occurrence of $ c $.\n\nDefine the set:\n$$\nK = \\left\\{ k \\in \\mathbb{Z}^+ \\mid \\exists\\, c \\in \\Sigma \\text{ such that } c \\text{ is } k\\text{-dominant} \\right\\}\n$$\n\nFind:\n$$\n\\min K\n$$","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF888C","tags":["binary search","implementation","two pointers"],"sample_group":[["abacaba","2"],["zzzzz","1"],["abcde","3"]],"created_at":"2026-03-03 11:00:39"}}