Next step, to choose which islands to build the teleporters on....I had no idea. Dug through the comments on the question page for hints. I found this big one:
Hence, I could just build one end of all teleporters on the same planet. And of course, that planet would offer the cheapest rate in the galaxy for building one!qwaker00 @ 5 Jul 2013 07:19 PMCan GFA create more than one teleport on a planet?zwolf10003 @ 5 Jul 2013 07:59 PMPlease specify if GFA can construct more than one teleport ending on a planet.jay_adm @ 5 Jul 2013 10:14 PM@zwolf10003 ,@qwaker00: yes.
The other end would go to each individual island/component. And for each island, the best place to end the teleporter would be the cheapest planet in the island.
With the solution planned out I proceeded to code it out in Python. Code here. Worked perfectly, but when submitted:
Sigh.
Time for port over to C++ again. But before that, I made a search for the fastest I/O operation I can achieve on C++. I landed upon this blog post. Tried the last method, but found that Windows does not have getchar_unlocked(). Replaced it with getchar() instead.
The result:
It's accepted!