In the last episodes of South Park we all can see that Trump aka Mr. Garrison became president. This is exactly what happened in the US. I think that Matt and Trey are smart enough for a competent guess of the outcome but of course they could have just made multiple versions for every possible outcome. Does anyone know facts about that?
South Park's production process is well-known, you'll only need to watch the documentary 6 Days to Air:
The film follows the show's hectic, rushed six-day production schedule, in which a 22-minute episode is completed just hours before its original air date.
(This is a quote from Wikipedia.)
Matter of fact, for this season's first episode they experienced a major malfunction mere hours before airtime:
“Member Berries” was broadcast at 10 p.m. on Sept. 14, but hardly without last-minute incident. That morning, South Park Studios suffered a system crash, and the episode’s audio went missing for an hour and a half.
When the episode was transmitted to Comedy Central, it had a mystery six-frame sync problem that was finally fixed and delivered one hour before airtime.
Moreover, there is evidence that for last week's episode the makers had featured a Clinton win, with the original synopsis being:
The new administration has plans for Gerald on an all-new episode of South Park titled "The Very First Gentleman" on Wednesday, November 9 at 10:00 p.m. ET/PT on Comedy Central. PC Principal tries one more time to make peace between the boys and the girls. Meanwhile, Gerald comes face-to-face with the Troll Hunter.
Note the title of the episode.
They failed on this particular episode. They planned a Clinton victory and had to rewrite a few scenes to make it match with Trump's victory. But for Obama's election, they had better luck back in 2008.
You can see that these episodes are written in a way that the winner can be changed quite easily. Very few scenes show or speak about who wins the election.