Compare commits
8 Commits
8a8cfa5c43
...
7f4f85f804
| Author | SHA1 | Date | |
|---|---|---|---|
| 7f4f85f804 | |||
| 7b7c85d278 | |||
| 9be61644a4 | |||
| 4481e9cc18 | |||
| 022eaf7a60 | |||
| 220d30556d | |||
| 947a85d630 | |||
| 17d266942c |
7
judgingmoose.py
Normal file
7
judgingmoose.py
Normal 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
9
karte.py
Normal 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
13
kleptography.py
Normal 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
3
licensetolaunch.py
Normal file
@@ -0,0 +1,3 @@
|
|||||||
|
_ = input()
|
||||||
|
junk = list(map(int, input().split()))
|
||||||
|
print(junk.index(min(junk)))
|
||||||
4
lostlineup.py
Normal file
4
lostlineup.py
Normal 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
6
maptiles2.py
Normal 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
5
mixedfractions.py
Normal 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
5
parking2.py
Normal 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)
|
||||||
Reference in New Issue
Block a user