시간 제한 | 메모리 제한 | 제출 | 정답 | 맞힌 사람 | 정답 비율 |
---|---|---|---|---|---|
2 초 | 256 MB | 137 | 34 | 33 | 33.000% |
Andy loves anagrams. For the uninitiated, an anagram is a word formed by rearranging the letters of another word, for example rasp can be rearranged to form spar. Andy is interested to know if two words are almost anagrams. A word is almost an anagram of another word if:
Your job is to help Andy to determine if two words are identical, anagrams, almost anagrams or nothing like each other.
The input contains a single test case.
The input will be a single line of text containing a pair of words separated by a single space. The words will be in lower case and will contain alphabetic characters only. Words will contain between 1 and 1000 letters inclusive.
Your program should produce one line of output as follows:
If the words are identical, output: worda is identical to wordb
If the words are anagrams, output: worda is an anagram of wordb
If the words are almost anagrams, output: worda is almost an anagram of wordb
Otherwise, output: worda is nothing like wordb
In all cases the first word in the output sentence must be the shorter word or if the words are the same length the first word must be the lexicographically least.
rasp spar
rasp is an anagram of spar
table able
able is almost an anagram of table
sable table
sable is almost an anagram of table
ICPC > Regionals > South Pacific > South Pacific Region > ACM South Pacific Western Division > ACM South Pacific Western Division 2015 J번
ICPC > Regionals > South Pacific > South Pacific Region > ACM South Pacific Eastern Division > ACM South Pacific Eastern Division 2015 F번
ICPC > Regionals > South Pacific > South Pacific Region > ACM South Pacific Central Division > ACM South Pacific Central Division 2015 B번