Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Nov 20, 2024
1 parent 7d533d7 commit d8b5009
Show file tree
Hide file tree
Showing 4 changed files with 38 additions and 0 deletions.
9 changes: 9 additions & 0 deletions src/drinkmenu.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
from collections import Counter

n, m = [int(d) for d in input().split()]
d = [input() for _ in range(n)]
c = Counter()
for _ in range(m):
name = input()
print(d[c[name] % n])
c[name] += 1
15 changes: 15 additions & 0 deletions src/equalshots.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
a, b = io.read("*n", "*n")
va, vb = 0, 0
for _ = 1, a do
c, v = io.read("*n", "*n")
va = va + c * v
end
for _ = 1, b do
c, v = io.read("*n", "*n")
vb = vb + c * v
end
if va == vb then
print("same")
else
print("different")
end
9 changes: 9 additions & 0 deletions src/equalshots.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
a, b = [int(d) for d in input().split()]
va, vb = 0, 0
for _ in range(a):
c, v = [int(d) for d in input().split()]
va += c * v
for _ in range(b):
c, v = [int(d) for d in input().split()]
vb += c * v
print("same" if va == vb else "different")
5 changes: 5 additions & 0 deletions src/ginfizz.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
print(f"{45*n} ml gin")
print(f"{30*n} ml fresh lemon juice")
print(f"{10*n} ml simple syrup")
print(f'{n} slice{"s" if n>1 else ""} of lemon')

0 comments on commit d8b5009

Please sign in to comment.