Skip to content
This repository was archived by the owner on Nov 10, 2020. It is now read-only.
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Empty file added week-01/lilmert/README.md
Empty file.
32 changes: 32 additions & 0 deletions week-01/lilmert/aboveaverage.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import sys

cases = int(sys.stdin.readline())

def reader():
cond = sys.stdin.read(1)
temp = []
while cond.isalnum():
temp.append(cond)
cond = sys.stdin.read(1)

return int(''.join(temp))

class Classroom:
def __init__(self, num_ppl, avg=None):
self.num_ppl = int(num_ppl)
self.avg = avg
self.grades = []

for i in range(cases):
temp_class = Classroom(reader())
for j in range(temp_class.num_ppl):
temp_class.grades.append(reader())

temp_avg = sum(temp_class.grades)/len(temp_class.grades)
count = 0
for grade in temp_class.grades:
if grade > temp_avg:
count += 1

output = count/len(temp_class.grades) * 100
print("{:.3f}%".format(output))
2 changes: 2 additions & 0 deletions week-01/lilmert/amsterdamdistance.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
import sys

6 changes: 6 additions & 0 deletions week-01/lilmert/autori.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
import sys

for char in sys.stdin.readline():
if char.isupper():
print(char, end="")
print()
33 changes: 33 additions & 0 deletions week-01/lilmert/towering.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,33 @@
import sys

line = sys.stdin.readline()

count = 0
heights = []
boxes = []
for num in line.split(" "):
if count < 6:
boxes.append(int(num))
else:
heights.append(int(num))
count += 1

boxes.sort(reverse=True)

def find_tower(box_list, total_height):
for i in range(4):
temp = len(box_list[i+1:])
for j in range(temp-1):
box1 = box_list[i]
box2 = box_list[i+j+1]
others = box_list[i+j+2:]
for box3 in others:
if box1+box2+box3==total_height:
print(box1, end=" ")
print(box2, end=" ")
print(box3, end=" ")

find_tower(boxes, heights[0])
find_tower(boxes, heights[1])
print()