Problem F
Dominant Strings
Input: standard input
Output: standard output
Time Limit: 2 seconds
Given
two strings s1 and s2, we say that s1
dominates s2 if the (multi)set of characters in s1
is a proper superset of the (multi)set of characters in s2.
For instance, "acmicpc" dominates "camp", but it does not
dominate "chimp" or "macpac". For a set S of
strings, we call the strings in S which are not dominated by any string
in S the dominant strings of S (even if they do not
dominate any strings in S).
Now,
your task is simply to find all the dominant strings of a set of strings.
The input contains a single set of strings, with one string per line. Each string consists of at least one and at most ten lower-case alphabetic characters. There will be at most 15000 strings, and no two strings will be identical. Input is terminated by end-of-file.
Output consists of all dominant strings in the input set, in alphabetical order, one word per line.
acmicpc cccp macpac chimp camp |
acmicpc chimp macpac
|
Problem setter: Per Austrin, KTH
Special Thanks: Mohammad Sajjad Hossain