Compare commits

...

6 Commits

Author SHA1 Message Date
910504b0d7 The Easiest Problem Is This One 2023-07-16 21:51:59 +02:00
95979cdcf0 The Last Problem 2023-07-16 21:39:42 +02:00
11de2df636 Kornislav 2023-07-16 21:36:14 +02:00
1c2396075e Moderate Pace 2023-07-16 21:31:41 +02:00
1182218885 Seven Wonders 2023-07-16 21:23:41 +02:00
2d740cf8d3 The Amazing Human Cannonball 2023-07-16 21:09:36 +02:00
6 changed files with 49 additions and 0 deletions

19
easiest.py Normal file
View File

@@ -0,0 +1,19 @@
def sumOfDigits(n: int) -> int:
sod = 0
while True:
sod += n % 10
n = n // 10
if n == 0:
return sod
n = int(input())
while n:
sodn = sumOfDigits(n)
p = 11
while True:
if sodn == sumOfDigits(n * p):
print(p)
break
p += 1
n = int(input())

12
humancannonball2.py Normal file
View File

@@ -0,0 +1,12 @@
from math import cos, sin, radians
n = int(input())
for _ in range(n):
v0, angle, x1, h1, h2 = map(float, input().split())
t = x1 / v0 / cos(radians(angle))
yt = v0 * t * sin(radians(angle)) - 0.5 * 9.81 * t**2
if h1 + 1 < yt < h2 - 1:
print("Safe")
else:
print("Not Safe")

2
kornislav.py Normal file
View File

@@ -0,0 +1,2 @@
ints = sorted(list(map(int, input().split())))
print(ints[0] * ints[2])

7
moderatepace.py Normal file
View File

@@ -0,0 +1,7 @@
n = int(input())
k = list(map(int, input().split()))
a = list(map(int, input().split()))
b = list(map(int, input().split()))
for i in range(n):
print(f"{sorted([k[i], a[i], b[i]])[1]} ", end="")

7
sevenwonders.py Normal file
View File

@@ -0,0 +1,7 @@
s = input().strip()
t = s.count("T")
c = s.count("C")
g = s.count("G")
print(t**2 + c**2 + g**2 + (min((t, c, g)) * 7))

2
thelastproblem.py Normal file
View File

@@ -0,0 +1,2 @@
s = input()
print(f"Thank you, {s}, and farewell!")