Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Aug 26, 2024
1 parent c006bf8 commit 5b80f3f
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
4 changes: 4 additions & 0 deletions src/klosettrod.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
n = int(input())
a = [int(d) for d in input().split()]
m = dict(zip(range(1, n + 1), a))
print(*sorted(m, key=lambda v: -m[v]))
5 changes: 5 additions & 0 deletions src/multiplications.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,5 @@
n = int(input())
p = 1
for _ in range(n):
p *= int(input())
print(p % (10**9 + 7))
11 changes: 11 additions & 0 deletions src/revisionskontroll.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
n = int(input())
e = set()
res = []
for v in input().split():
v = int(v)
if v not in e:
res.append(1)
e.add(v)
else:
res.append(0)
print(*res)
8 changes: 8 additions & 0 deletions src/translation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
_ = input()
w = input().split()
m = int(input())
d = {}
for _ in range(m):
k, v = input().split()
d[k] = v
print(*[d[k] for k in w])

0 comments on commit 5b80f3f

Please sign in to comment.