시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
4 초 (추가 시간 없음) | 256 MB | 137 | 84 | 62 | 59.615% |
Two words are anagrams if the letters of the first word can be reordered to obtain the second one. An instance of anagrams is the pair “listen” and “silent”.
You are given a list of words, each word consisting of lowercase letters. Your goal is to filter this list by dropping any word whose anagram has already appeared earlier on the list.
The first line contains $n$, the length of the list. This is followed by $n$ lines, each containing one word.
Print out the list of words without anagrams, one word per line. The words should appear in the same order as given in the input.
5 listen santa satan silent cat
listen santa cat
ICPC > Regionals > Europe > Central European Regional Contest > CERC 2021 X번