Skip to content

Commit

Permalink
add example
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Aug 27, 2024
1 parent 8844d88 commit 8a37beb
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions src/haypoints.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
m, n = [int(d) for d in input().split()]
h = {}
for _ in range(m):
k, v = input().split()
h[k] = int(v)
for _ in range(n):
res = 0
while True:
s = input()
if s == ".":
break
w = s.split()
res += sum(h.get(k, 0) for k in w)
print(res)

0 comments on commit 8a37beb

Please sign in to comment.