Current work

This commit is contained in:
2026-08-03 19:03:58 +01:00
parent b48299efb7
commit a79ff12290
46 changed files with 1345 additions and 0 deletions
+24
View File
@@ -0,0 +1,24 @@
from collections import Counter
read = open("blocks.in")
n = int(read.readline())
blocksNeeded = [0] * 26
for _ in range(n):
a, b = read.readline().split()
a, b = Counter(a), Counter(b)
for key in a:
if key in b:
blocksNeeded[ord(key) - ord("a")] += max(a[key], b[key])
else:
blocksNeeded[ord(key) - ord("a")] += a[key]
for key in b:
if key in a:
continue
else:
blocksNeeded[ord(key) - ord("a")] += b[key]
with open("blocks.out", "w") as out:
for block in blocksNeeded:
print(block, file=out)