If CNBC's Jim Cramer knows one thing about the United States Congress, it's that "a house divided against itself can produce some amazing profits" for investors, he said one day after the 2018 midterm elections.

On Tuesday, the Democratic Party regained control in the House of Representatives, while the Republican Party maintained its majority in the Senate. Results like these tend to cause congressional gridlock, which is usually good for stock-pickers, Cramer said.

"Gridlock comes with another set of consequences," Cramer, host of "Mad Money," said Wednesday as stocks surged higher.

One such consequence could be "a slowdown in the U.S. economy, as there's very little chance that we'll get a second tax cut or an infrastructure bill, or anything that could give us a boost" given that newly empowered House Democrats may not want to give the president what he wants ahead of 2020, Cramer said.

"What do you do in this situation? You buy the fastest-growing companies, the ones that can keep making their numbers in a slowdown," he said. Among his recommendations were the cloud stocks, many of which reported strong earnings on Tuesday, as well as the stocks of Amazon and Apple.

"[Amazon] may have sandbagged with its conservative guidance, giving a low-ball number that can be beaten," the "Mad Money" host said. "Any company willing to have three global headquarters must be doing pretty darned well."

As for Apple, Cramer pointed to his Tuesday analysis with Carolyn Boroden, a reputable technician who said the iPhone maker's stock could start rallying as soon as this week.

Other potential winners were health-care plays HCA, UnitedHealth and Centene, all of which benefit from House Democrats preserving the current state of U.S. health care, Cramer said. He also blessed buying big pharmaceutical names like Johnson & Johnson, Merck and Pfizer and device plays Abbott Labs, DexCom and Medtronic.

"Finally, I've got to admit that the White House is a neverending source of fantastic stock opportunities," the "Mad Money" host said, addressing the news that Attorney General Jeff Sessions resigned under pressure from President Donald Trump.

"Sessions hated pot more than anyone else" in the government, he said. "The news of his departure sent Canopy Growth and the rest of the cannabis stocks flying, as investors wagered that no attorney general could be worse on this issue."

And while Cramer still worried about the Federal Reserve's plans for interest rates, he said that falling oil prices and slumping mortgage applications could change the central bank's tune.

"Now that the [election] is in the rear-view mirror, we can surge higher like we did today, but we're still hostage to the Fed," he said. "I don't mind the December rate hike. Employment's still red hot. [...] I just hope that they'll look at what's happening in all parts of the economy, not just the consumer, not just unemployment, and decide that they can afford to wait and see what's going to happen before tightening any more than that."