LeetCode的提交外挂

LeetCode的提交外挂

说明

偶然间,在做题目的时候,查看不同运行时间的参考答案时,发现的一种提速方法,应该是后台运行时使用了cin和cout,所以对任意提交代码都可以提速。

代码

放在所有代码最前面

static const auto _ = []()
{
  ios::sync_with_stdio(false);
  cin.tie(nullptr);
  return nullptr;
}();
发布了173 篇原创文章 · 获赞 6 · 访问量 4万+

猜你喜欢

转载自blog.csdn.net/shidonghang/article/details/103191719