아직 만들고 있는 페이지입니다.

이 페이지는 아직 만드는 중입니다. 보이는 내용은 바뀔 수 있습니다.

Anagram

면접 대비

시간 제한4초메모리 제한256 MB

요약
단어 목록에서 앞서 등장한 단어의 애너그램인 단어를 제거하고 원래 순서를 유지해 출력한다.
난이도

보통10점 중 4점

유형
해시맵, 정렬, 문자열
정답자
아직 제출이 없습니다

문제

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 nn, the length of the list. This is followed by nn 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.

제한

  • 1≤n≤1051 ≤ n ≤ 10^5
  • All letters are lowercase letters of the English alphabet.
  • Length of any word will not exceed 100100.

예제1

  1. 예제 1

    입력
    5
    listen
    santa
    satan
    silent
    cat
    
    예상 출력
    listen
    santa
    cat