Submission details
Task:Anagrams
Sender:ray_a
Submission time:2020-09-26 14:40:02 +0300
Language:Python3 (PyPy3)
Status:READY
Result:
Test results
testverdicttime
#1--details
#2--details
#3--details
#4--details
#52.64 sdetails
#62.64 sdetails
#7ACCEPTED0.05 sdetails
#8ACCEPTED0.05 sdetails
#9ACCEPTED0.05 sdetails

Code

def main() :
    n = int(input())
    arr = [] 
    for _ in range(n) :
        arr.append(input())
    word = arr.copy()
    
    for i in range(0,len(arr)) :
        arr[i] =    "".join(sorted(arr[i]))
    anagrams = []
    for i in range(len(arr)-1) :
        count = 1
        pos = [i]
        check = arr[i]
        for j in range(i+1, len(arr)) : 
            if arr[j] == check :
                count += 1
                pos.append(j)
        if count > 1 :
            anagrams.append([count,pos])
    print(len(anagrams))
    for i in anagrams :
        print(i[0])
        for j in i[1] :
            print(word[j])
    pass

if __name__ == "__main__":
    main()

Test details

Test 1

Verdict:

input
68760
aakkonen
aakkosellinen
aakkosellisesti
aakkosellisuus
...

correct output
3076
2
haaraantua
raahaantua
2
...

user output
(empty)

Test 2

Verdict:

input
370099
a
aa
aaa
aah
...

correct output
30178
2
basiparachromatin
marsipobranchiata
2
...

user output
(empty)

Test 3

Verdict:

input
100000
cnhmuewgnum
dxkmhzhetnmxadtcy
hfjqwavsiguwpludsketibe
xwxolrmvkz
...

correct output
0

user output
(empty)

Test 4

Verdict:

input
400000
vlcsa
eltwde
wdcwwkubs
tmuxbirj
...

correct output
0

user output
(empty)

Test 5

Verdict:

input
400000
ebhfigdacjlk
aecfdijlhkgb
jfekhbidacgl
cehajbidfklg
...

correct output
1
400000
abcdeighjlfk
abcdeiglhfjk
abcdfkilejgh
...

user output
(empty)

Test 6

Verdict:

input
400000
cbaabghadefb
hbbgfaeabdac
abaedcbgfbha
hcfadbbbeaag
...

correct output
1
400000
aaabbbcfegdh
aaabbbcfghed
aaabbbdcgfhe
...

user output
(empty)

Test 7

Verdict: ACCEPTED

input
1
a

correct output
0

user output
0

Test 8

Verdict: ACCEPTED

input
2
ab
ba

correct output
1
2
ab
ba

user output
1
2
ab
ba

Test 9

Verdict: ACCEPTED

input
2
aa
ab

correct output
0

user output
0