在利用C++進行編程時,如果利用常用頭文件可使得效率大大的提升,無論是在進行ACM競賽,還是在其他算法競賽中,如果熟練掌握常用頭文件,不亞於擁有一把神兵利器。
在算法競賽中常用的頭文件有:
C++頭文件:
#include <algorithm> //通用算法
#include <deque> //雙端隊列容器
#include <list> //線性列表容器
#include <map> //映射容器
#include <iostream> //基本輸入輸出流
#include <queue> //隊列容器
#include <set> //集合容器
#include <stack> //堆棧容器
#include <string> //字符串類
#include <vector> //動態數組容器
#include <hash_map> //字典(hash map)
#include <math> //數學函數類
C頭文件:
#include <cmath>
#include <complex>
#include <cstdio>
#include <cstdlib>
#include <cstring>
在進行C++編程時,C與C++頭文件都可直接使用,后面將一一介紹這些頭文件。
推薦一個比較好的C++學習網站
http:www.cplusplus.com