| Task: | Anagrams |
| Sender: | toothfairy |
| Submission time: | 2020-09-26 14:19:53 +0300 |
| Language: | Python3 (CPython3) |
| Status: | READY |
| Result: | WRONG ANSWER |
| test | verdict | time | |
|---|---|---|---|
| #1 | WRONG ANSWER | 0.33 s | details |
| #2 | WRONG ANSWER | 1.76 s | details |
| #3 | WRONG ANSWER | 0.59 s | details |
| #4 | WRONG ANSWER | 1.80 s | details |
| #5 | WRONG ANSWER | 1.76 s | details |
| #6 | WRONG ANSWER | 1.72 s | details |
| #7 | WRONG ANSWER | 0.02 s | details |
| #8 | WRONG ANSWER | 0.02 s | details |
| #9 | WRONG ANSWER | 0.02 s | details |
Code
n = int(input())
arr = [0] * n
dict = {}
anna = {}
counter = 0
# add the input in
for i in range(n):
arr[i] = input()
# add to dictionary and maintain the arr of anna
for k in range(n):
orgStr = arr[k]
temp = list(orgStr)
temp.sort()
sortedStr = "".join(temp)
# print("get ", dict.get(sortedStr))
if(not not dict.get(sortedStr)):
# print("wtf ", dict.get(sortedStr))
dict[sortedStr].append(orgStr)
if(not anna.get(sortedStr)):
anna[sortedStr] = 2
else:
# print("moeowoow ", anna.get(sortedStr))
anna[sortedStr] += 1
else:
print(sortedStr)
dict[sortedStr] = [orgStr]
for key in anna:
print(anna.get(key))
for w in dict.get(key):
print(w)
# a = "bacterial
# arr = list("bacterial")
# arr.sort()
# print("".join(arr))Test details
Test 1
Verdict: WRONG ANSWER
| input |
|---|
| 68760 aakkonen aakkosellinen aakkosellisesti aakkosellisuus ... |
| correct output |
|---|
| 3076 2 haaraantua raahaantua 2 ... |
| user output |
|---|
| aaekknno aaeeikkllnnos aaeeiikkllossst aaeikkllosssuu aaaiikknostt ... Truncated |
Test 2
Verdict: WRONG ANSWER
| input |
|---|
| 370099 a aa aaa aah ... |
| correct output |
|---|
| 30178 2 basiparachromatin marsipobranchiata 2 ... |
| user output |
|---|
| a aa aaa aah aadeh ... Truncated |
Test 3
Verdict: WRONG ANSWER
| input |
|---|
| 100000 cnhmuewgnum dxkmhzhetnmxadtcy hfjqwavsiguwpludsketibe xwxolrmvkz ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| ceghmmnnuuw acddehhkmmnttxxyz abdeefghiijklpqsstuuvww klmorvwxxz cccgijjlmmnorrrtwwwyzz ... Truncated |
Test 4
Verdict: WRONG ANSWER
| input |
|---|
| 400000 vlcsa eltwde wdcwwkubs tmuxbirj ... |
| correct output |
|---|
| 0 |
| user output |
|---|
| aclsv deeltw bcdksuwww bijmrtux aadfitwyz ... Truncated |
Test 5
Verdict: WRONG ANSWER
| input |
|---|
| 400000 ebhfigdacjlk aecfdijlhkgb jfekhbidacgl cehajbidfklg ... |
| correct output |
|---|
| 1 400000 abcdeighjlfk abcdeiglhfjk abcdfkilejgh ... |
| user output |
|---|
| abcdefghijkl 400000 ebhfigdacjlk aecfdijlhkgb jfekhbidacgl ... Truncated |
Test 6
Verdict: WRONG ANSWER
| input |
|---|
| 400000 cbaabghadefb hbbgfaeabdac abaedcbgfbha hcfadbbbeaag ... |
| correct output |
|---|
| 1 400000 aaabbbcfegdh aaabbbcfghed aaabbbdcgfhe ... |
| user output |
|---|
| aaabbbcdefgh 400000 cbaabghadefb hbbgfaeabdac abaedcbgfbha ... Truncated |
Test 7
Verdict: WRONG ANSWER
| input |
|---|
| 1 a |
| correct output |
|---|
| 0 |
| user output |
|---|
| a |
Test 8
Verdict: WRONG ANSWER
| input |
|---|
| 2 ab ba |
| correct output |
|---|
| 1 2 ab ba |
| user output |
|---|
| ab 2 ab ba |
Test 9
Verdict: WRONG ANSWER
| input |
|---|
| 2 aa ab |
| correct output |
|---|
| 0 |
| user output |
|---|
| aa ab |
