最近在看acm的ac代码时,发现大神用的头文件只有一行,而自己有时写头文件都要写老半天。在网上查了很多资料,终于也可以像大佬一样只写一行头文件,现在写代码都感觉很轻松。
其实在codeforces已经有过说明,那我就简单翻一下吧。
- 如果安装了MinGW的直接在文件夹里面找到bits这个文件夹,把里面内容复制粘贴到vs的头文件库(一般是在c盘的安装目录)里面。
- 如果没有安装MinGW,那么自己在vs的include文件夹里面新建一个bits文件夹,里面新建一个名叫stdc++.h的头文件,里面写你常用的头文件,(我添加的位置就在C:\Program Files (x86)\Microsoft Visual Studio 14.0\VC\include\bits),这里我搬运一下stdc++.h源文件:
stdc++.h
// C++ includes used for precompiling -*- C++ -*-
// Copyright (C) 2003-2015 Free Software Foundation, Inc.
//
// This file is part of the GNU ISO C++ Library. This library is free
// software; you can redistribute it and/or modify it under the
// terms of the GNU General Public License as published by the
// Free Software Foundation; either version 3, or (at your option)
// any later version.
//