Skip to content

Commit

Permalink
add examples
Browse files Browse the repository at this point in the history
  • Loading branch information
zehengl committed Dec 4, 2023
1 parent e09e258 commit 07c956d
Show file tree
Hide file tree
Showing 3 changed files with 22 additions and 0 deletions.
12 changes: 12 additions & 0 deletions src/hardwoodspecies.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
from collections import Counter

names = []
while True:
try:
names.append(input())
except:
break
total = len(names)
names = Counter(names)
for n in sorted(names):
print(n, f"{names[n]/total*100:.6f}")
8 changes: 8 additions & 0 deletions src/inflation.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
n = int(input())
c = [int(d) for d in input().split()]
s = range(1, n + 1)
f = [b / a for a, b in zip(s, sorted(c))]
if max(f) > 1:
print("impossible")
else:
print(min(f))
2 changes: 2 additions & 0 deletions src/pinnifraendi.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
n = int(input())
print(f"0.{'0'*(n-1)}1")

0 comments on commit 07c956d

Please sign in to comment.