Compare commits

...

8 Commits

Author SHA1 Message Date
7f4f85f804 Identifying Map Tiles 2023-07-19 21:21:47 +02:00
7b7c85d278 Judging Moose 2023-07-19 20:56:22 +02:00
9be61644a4 Karte 2023-07-19 20:51:49 +02:00
4481e9cc18 Kleptography 2023-07-19 20:40:14 +02:00
022eaf7a60 License to Launch 2023-07-18 22:57:18 +02:00
220d30556d Lost Lineup 2023-07-18 22:54:03 +02:00
947a85d630 Mixed Fractions 2023-07-18 22:40:18 +02:00
17d266942c Parking 2023-07-18 22:34:23 +02:00
8 changed files with 52 additions and 0 deletions

7
judgingmoose.py Normal file
View File

@@ -0,0 +1,7 @@
l, r = map(int, input().split())
if l == r == 0:
print("Not a moose")
elif l == r:
print(f"Even {l+r}")
else:
print(f"Odd {max((l, r)) * 2}")

9
karte.py Normal file
View File

@@ -0,0 +1,9 @@
cards = input()
cards = [cards[i : i + 3] for i in range(0, len(cards), 3)]
unique_cards = set(cards)
if len(cards) > len(unique_cards):
print("GRESKA")
else:
for suit in ('P', 'K', 'H', 'T'):
print(13-len([card for card in cards if card[0] == suit]), end=' ')

13
kleptography.py Normal file
View File

@@ -0,0 +1,13 @@
n, m = map(int, input().split())
knowntext = input()
ciphertext = input()
plaintext = [""] * m
for i in range(n):
plaintext[-n + i] = knowntext[i]
for i in range(m - 1, -1, -1):
char = chr((ord(ciphertext[i]) - ord(plaintext[i])) % 26 + 97)
if i - n >= 0:
plaintext[i - n] = char
print("".join(plaintext))

3
licensetolaunch.py Normal file
View File

@@ -0,0 +1,3 @@
_ = input()
junk = list(map(int, input().split()))
print(junk.index(min(junk)))

4
lostlineup.py Normal file
View File

@@ -0,0 +1,4 @@
n = int(input())
d = list(map(int, input().split()))
pos = [1] + [d.index(i) + 2 for i in range(n - 1)]
print(" ".join(map(str, pos)))

6
maptiles2.py Normal file
View File

@@ -0,0 +1,6 @@
quadkey = input()
zoomlevel = len(quadkey)
interleaved_coordinates = format(int(quadkey, 4), f"0{zoomlevel*2}b")
y = "".join([interleaved_coordinates[i] for i in range(0, zoomlevel * 2, 2)])
x = "".join([interleaved_coordinates[i] for i in range(1, zoomlevel * 2, 2)])
print(zoomlevel, int(x, 2), int(y, 2))

5
mixedfractions.py Normal file
View File

@@ -0,0 +1,5 @@
n, d = map(int, input().split())
while not (n == d == 0):
print(f"{n // d} {n % d} / {d}")
n, d = map(int, input().split())

5
parking2.py Normal file
View File

@@ -0,0 +1,5 @@
t = int(input())
for _ in range(t):
n = int(input())
x = list(map(int, input().split()))
print((max(x) - min(x)) * 2)