Compare commits

..

4 Commits

Author SHA1 Message Date
020015474f Easy problems solved on 2024-11-12 2024-11-12 22:53:08 +01:00
799f2283c7 GlitchBot 2023-11-15 22:47:23 +01:00
b58f0998db EpigDanceOff 2023-11-15 22:20:01 +01:00
ae55249b47 NOP 2023-11-15 22:10:55 +01:00
24 changed files with 189 additions and 0 deletions

4
aleidibio.py Normal file
View File

@@ -0,0 +1,4 @@
a = int(input())
b = int(input())
c = int(input())
print(c - a - b)

3
astackofgold.py Normal file
View File

@@ -0,0 +1,3 @@
w, s = map(int, input().split())
c = s * (s + 1) / 2
print(int((w - (c * 29260)) / 110))

9
barcelona.py Normal file
View File

@@ -0,0 +1,9 @@
n, k = map(int, input().split())
pos = list(map(int, input().split()))
if pos[0] == k:
print("fyrst")
elif pos[1] == k:
print("naestfyrst")
else:
print(f"{pos.index(k)+1} fyrst")

1
bergmal.py Normal file
View File

@@ -0,0 +1 @@
print(input())

11
dfyrirdreki.py Normal file
View File

@@ -0,0 +1,11 @@
a = int(input())
b = int(input())
c = int(input())
d = b**2 - 4 * a * c
if d > 0:
print(2)
elif d < 0:
print(0)
else:
print(1)

1
dragafra.py Normal file
View File

@@ -0,0 +1 @@
print(int(input()) - int(input()))

17
epigdanceoff.py Normal file
View File

@@ -0,0 +1,17 @@
n, m = map(int, input().split())
lines = []
for _ in range(n):
lines.append(input())
t = 1
for col in range(m):
new_frame = True
for row in lines:
if row[col] != "_":
new_frame = False
break
if new_frame:
t += 1
print(t)

14
fallingsnow2.py Normal file
View File

@@ -0,0 +1,14 @@
n, m = map(int, input().split())
snows = [
0,
] * m
for _ in range(n):
for i, x in enumerate(input()):
snows[i] += 1 if x == "S" else 0
for r in range(n):
for c in range(m):
print("S" if snows[c] >= n - r else ".", end="")
print()

1
flatbokuveisla.py Normal file
View File

@@ -0,0 +1 @@
print(int(input()) % int(input()))

56
glitchbot.py Normal file
View File

@@ -0,0 +1,56 @@
NORTH = 0
EAST = 1
SOUTH = 2
WEST = 3
LEFT = 0
RIGHT = 1
FORWARD = 2
def run_program(program: list) -> tuple:
x, y = 0, 0
facing = NORTH
for instruction in program:
if instruction == LEFT:
facing = (facing - 1) % 4
elif instruction == RIGHT:
facing = (facing + 1) % 4
elif instruction == FORWARD:
if facing == NORTH:
y += 1
elif facing == SOUTH:
y -= 1
elif facing == EAST:
x += 1
elif facing == WEST:
x -= 1
return x, y
x, y = map(int, input().split())
instruction_count = int(input())
program = []
for _ in range(instruction_count):
instruction = input()
if instruction == "Left":
program.append(LEFT)
elif instruction == "Right":
program.append(RIGHT)
elif instruction == "Forward":
program.append(FORWARD)
for i in range(len(program)):
for _ in range(3):
program[i] = (program[i] + 1) % 3
result = run_program(program)
if result == (x, y):
print(
f"{i+1} {'Left' if program[i] == LEFT else 'Right' if program[i] == RIGHT else 'Forward'}"
)
exit()

1
hipphipp.py Normal file
View File

@@ -0,0 +1 @@
print("Hipp hipp hurra!\n" * 20)

3
hipphipphurra.py Normal file
View File

@@ -0,0 +1,3 @@
name = input()
age = int(input())
print(f"Hipp hipp hurra, {name}!\n" * age)

10
hiptobesquare.py Normal file
View File

@@ -0,0 +1,10 @@
t = int(input())
for _ in range(t):
n = int(input()) + 1
max_size = int(n**0.5)
if max_size % 2 == 0:
max_size -= 2
else:
max_size -= 1
print(max_size // 2)

1
kvedja.py Normal file
View File

@@ -0,0 +1 @@
print(f"Kvedja,\n{input()}")

1
lubbilaerir.py Normal file
View File

@@ -0,0 +1 @@
print(input()[0])

5
mergjadmal.py Normal file
View File

@@ -0,0 +1,5 @@
s = input()
if "69" in s or "420" in s:
print("Mergjad!")
else:
print("Leim!")

23
nop.py Normal file
View File

@@ -0,0 +1,23 @@
UPPERS = "ABCDEFGHIJKLMNOPQRSTUVWXYZ"
instructions = input().strip()
i = 0
nop_count = 0
while True:
try:
if instructions[i + 1] in UPPERS:
nop_count += 3
i += 1
elif instructions[i + 2] in UPPERS:
nop_count += 2
i += 2
elif instructions[i + 3] in UPPERS:
nop_count += 1
i += 3
else:
i += 4
except IndexError:
print(nop_count)
exit()

3
reduplikation.py Normal file
View File

@@ -0,0 +1,3 @@
s = input()
r = int(input())
print(s * r)

3
skak.py Normal file
View File

@@ -0,0 +1,3 @@
x1, y1 = map(int, input().split())
x2, y2 = map(int, input().split())
print(1 if x1 == x2 or y1 == y2 else 2)

1
storafmaeli.py Normal file
View File

@@ -0,0 +1 @@
print("Jebb" if int(input()) % 10 == 0 else "Neibb")

8
takkar.py Normal file
View File

@@ -0,0 +1,8 @@
a = int(input())
b = int(input())
if a > b:
print("MAGA!")
elif b > a:
print("FAKE NEWS!")
else:
print("WORLD WAR 3!")

1
tilhamingju.py Normal file
View File

@@ -0,0 +1 @@
print("TIL HAMINGJU MED AFMAELID FORRITUNARKEPPNI FRAMHALDSSKOLANNA!")

View File

@@ -0,0 +1 @@
print(int(input()) - 1)

11
whichnumberkindisit2.py Normal file
View File

@@ -0,0 +1,11 @@
t = int(input())
for _ in range(t):
n = int(input())
out = ""
if n % 2 == 1:
out = "O"
if (n**0.5) % 1 == 0:
out += "S"
if out == "":
out = "EMPTY"
print(out)