{"problem":{"name":"097. Neon Lights","description":{"content":"Neon Lights You are trying to find strings of text to put on neon lights. You want to fully test the extent of the neon lights' writing style for letters, so you want to pick the string of text that ","description_type":"Markdown"},"platform":"Codeforces","limit":{"time_limit":1000,"memory_limit":262144},"difficulty":"None","is_remote":true,"is_sync":true,"sync_url":null,"sign":"CF10269097"},"statements":[{"statement_type":"Markdown","content":"Neon Lights\n\nYou are trying to find strings of text to put on neon lights. You want to fully test the extent of the neon lights' writing style for letters, so you want to pick the string of text that has the highest number of distinct (different) letters from a selection of possible strings of text.\n\nThe first line of input contains a positive integer $n$ indicating the number of strings of text that you are considering putting on neon lights. The next $n$ lines each contain each string of text, consisting of only lowercase letters and spaces.\n\nOutput the string of text from the possibilities which has the highest number of distinct letters. If two strings of text contain the same number of distinct letters, choose the one that comes first in the input file.\n\n## Input\n\nThe first line of input contains a positive integer $n$ indicating the number of strings of text that you are considering putting on neon lights. The next $n$ lines each contain each string of text, consisting of only lowercase letters and spaces.\n\n## Output\n\nOutput the string of text from the possibilities which has the highest number of distinct letters. If two strings of text contain the same number of distinct letters, choose the one that comes first in the input file.\n\n[samples]","is_translate":false,"language":"English"},{"statement_type":"Markdown","content":"**Definitions**  \nLet $ n \\in \\mathbb{Z}^+ $ be the number of strings.  \nLet $ S = (s_1, s_2, \\dots, s_n) $ be a sequence of strings, where each $ s_i $ is a string over the alphabet $ \\Sigma = \\{a, b, \\dots, z\\} \\cup \\{\\text{space}\\} $.\n\n**Constraints**  \n1. $ n \\geq 1 $  \n2. Each $ s_i $ contains only lowercase English letters and spaces.\n\n**Objective**  \nFind the string $ s_k \\in S $ such that:  \n$$\nk = \\min\\left\\{ i \\in \\{1, \\dots, n\\} \\mid | \\text{distinct letters in } s_i | = \\max_{1 \\leq j \\leq n} | \\text{distinct letters in } s_j | \\right\\}\n$$  \nwhere \"distinct letters\" excludes spaces and considers only characters in $ \\{a, b, \\dots, z\\} $.","is_translate":false,"language":"Formal"}],"meta":{"iden":"CF10269097","tags":[],"sample_group":[],"created_at":"2026-03-03 11:00:39"}}