Submission #19563443


Source Code Expand

Copy
n = int(input())
s = list(input() for _ in range(n))
s2 = []
for i in range(n):
    s2i = list(s[i][j] for j in range(len(s[i])))
    s2.append(sorted(s2i))
s2.sort()
kind = []
for s2i in s2:
    if s2i not in kind:
        kind.append(s2i)
cnt = []
for i in range(len(kind)):
    if s2.count(kind[i]) > 1:
        cnt.append(s2.count(kind[i]))
ans = 0
for cnti in cnt:
    ans += cnti*(cnti-1)//2
print(ans)

Submission Info

Submission Time
Task C - Green Bin
User Katsuhito
Language Python (3.8.2)
Score 0
Code Size 426 Byte
Status TLE
Exec Time 2207 ms
Memory 37944 KB

Judge Result

Set Name Sample All
Score / Max Score 0 / 0 0 / 300
Status
AC × 3
AC × 6
TLE × 7
Set Name Test Cases
Sample a01, a02, a03
All a01, a02, a03, b04, b05, b06, b07, b08, b09, b10, b11, b12, b13
Case Name Status Exec Time Memory
a01 AC 29 ms 9056 KB
a02 AC 23 ms 8892 KB
a03 AC 24 ms 8992 KB
b04 AC 27 ms 9060 KB
b05 TLE 2207 ms 37944 KB
b06 TLE 2207 ms 37804 KB
b07 TLE 2207 ms 37632 KB
b08 TLE 2207 ms 37800 KB
b09 TLE 2207 ms 37804 KB
b10 TLE 2207 ms 37872 KB
b11 AC 374 ms 37188 KB
b12 TLE 2207 ms 37732 KB
b13 AC 62 ms 9140 KB