Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Aug 27, 2024
1 parent ae51d7e commit 523918c
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
15 changes: 15 additions & 0 deletions src/grandpabernie.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
n = int(input())
m = {}
for _ in range(n):
c, y = input().split()
y = int(y)
if c not in m:
m[c] = [y]
else:
m[c].append(y)
for c in m:
m[c] = sorted(m[c])
q = int(input())
for _ in range(q):
c, i = input().split()
print(m[c][int(i) - 1])
9 changes: 9 additions & 0 deletions src/sottkvi.lua
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
n, k, today = io.read("*n", "*n", "*n")
res = 0
for _ = 1, n do
d = io.read("*n")
if d + 14 - today <= k then
res = res + 1
end
end
print(res)

0 comments on commit 523918c

Please sign in to comment.