Skip to content

Instantly share code, notes, and snippets.

@popey456963
Created October 24, 2015 22:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save popey456963/19bfd70ac22e24bb0805 to your computer and use it in GitHub Desktop.
Save popey456963/19bfd70ac22e24bb0805 to your computer and use it in GitHub Desktop.
SpaceShips
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)
@popey456963
Copy link
Author

2
4
Alpha Beta
20 30
Gems Marble
Alpha Gems
Beta 30
Beta Marble
20 Gems
Alpha 20 Gems
Beta 30 Marble
1
2
Alpha
20
Gems
Alpha Gems
20 Gems
Alpha 20 Gems
2
5
Mirkwood Moria
1 2
Truesilver Mithril
Moria Mithril
Mithril 1
1 Moria
Truesilver Mirkwood
2 Truesilver
Mirkwood 2 Truesilver
Moria 1 Mithril
4
8
AAN GHG PNF ZZ9
22 45 80 404
Iridium Crystalantium Naquadah Plutonium
AAN Iridium
45 Plutonium
404 PNF
404 Crystalantium
80 ZZ9
80 Naquadah
AAN 22
GHG Plutonium
AAN 22 Iridium
GHG 45 Plutonium
PNF 404 Crystalantium
ZZ9 80 Naquadah

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment