Skip to content

Commit

Permalink
Add kattis prob kitten in python3
Browse files Browse the repository at this point in the history
  • Loading branch information
iandioch committed Mar 3, 2017
1 parent 116524d commit 51bf763
Showing 1 changed file with 18 additions and 0 deletions.
18 changes: 18 additions & 0 deletions kattis/kitten/solution.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
d = {}

k = int(input())

while True:
p = list(map(int, input().split()))
if len(p) == 1:
break
for j in p[1:]:
d[j] = p[0]

while True:
print(k, end=' ')
if k in d:
k = d[k]
else:
print()
break

0 comments on commit 51bf763

Please sign in to comment.