Created
October 24, 2015 22:55
-
-
Save popey456963/19bfd70ac22e24bb0805 to your computer and use it in GitHub Desktop.
SpaceShips
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
site_count = int(input()) | |
couple_count = int(input()) | |
names = input().split() | |
ids = input().split() | |
minerals = input().split() | |
data = [] | |
for i in range(couple_count): | |
data.append(input().split()) | |
print(data) | |
for key,val in enumerate(range(site_count)): | |
name = names[key] | |
id = "" | |
mineral = "" | |
for i in data: | |
if i[0] == name: | |
try: | |
x = int(i[1]) | |
id = i[1] | |
except: | |
mineral = i[1] | |
else: | |
if i[0] not in names: | |
pass | |
for i in data: | |
if i[0] not in names: | |
if i[0] == id: | |
mineral = i[1] | |
if i[0] == mineral: | |
id = i[1] | |
print(name + " " + id + " " + mineral) |
Author
popey456963
commented
Oct 24, 2015
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment