Longest word and non-ocurring letters

Given a sequence of words, we wish to know:

  1. The longest word appearing in the sequence.

  2. All the letters that do not appear in any of its words (the first in the input sequence, when ties occur).

For solving this second item, your program must implement the function

void print_false(const vector<<bool>>& @v@);

which prints, for any position ii of vector @v@ holding value @false@, the character with ASCII code a+i'a' + i.

Input

The input is formed by a natural n>0n > 0 followed by nn non-empty words. Each word is composed exclusively by lowercase letters.

Output

Print the longest word in the input sequence (the first in the input sequence, in case of a tie), followed by the ordered list of lowercase letters that do not appear in any word of the sequence.

Observation

You may find useful to define and use the constant @LENGTH_ALPHABET@,

const int LENGTH_ALPHABET = ’z’ - ’a’ + 1;

 

Problem information

Author: Unknown
Translator: Maria Serna

Generation: 2026-01-25T14:35:50.119Z

© Jutge.org, 2006–2026.
https://jutge.org