create dev channel

This commit is contained in:
2025-05-07 04:44:30 +09:00
parent 603fca2b20
commit 16a8e59450
426 changed files with 643 additions and 36 deletions

16
zeta/py/completed/1339.py Normal file
View File

@@ -0,0 +1,16 @@
def solve(N: int, W: list):
V = {}
for w in W:
for i, a in enumerate(w[::-1]):
if a not in V:
V[a] = 0
V[a] += 10 ** i
S = list(sorted(V.items(), key=lambda x: x[1], reverse=True))
return sum([(9 - i) * S[i][1] for i in range(len(S))])
if __name__ == '__main__':
N = int(input())
W = [input() for _ in range(N)]
print(solve(N, W))