算法常用庫與函數(shù)[持續(xù)更新]
2022-03-30 21:37 幻霞 閱讀(43) 評(píng)論(0) 收藏 舉報(bào)#include<bits/stdc++.h>
常用萬能頭文件
#include<iostream>
全名 input /output stream:輸入輸出流
#include <algorithm>
算法庫的函數(shù)
#include <cstring> #include <string.h>
這兩個(gè)代碼在做算法的時(shí)候作用等價(jià)
詳細(xì)可以參考:https://blog.csdn.net/zollty/article/details/7291889
#include <cstdio>
#include <stdio.h>
同理,詳細(xì)請(qǐng)參考:https://blog.csdn.net/weixin_44703894/article/details/117876697
#include<stdlib.h>
全名standard library ,標(biāo)準(zhǔn)庫文件,內(nèi)含許多有用的方法,其中算法用的最多的當(dāng)屬qsort,還有一些常用的值比如INT_MIN,INT_MAX
#include <vector> //集合,可變長數(shù)組 #include <map>//表,鍵值對(duì) #include <queue>//隊(duì)列,先入先出 #include <stack>//棧,先入后出 #include <set>//集合,不重復(fù)
ios::sync_with_stdio(false), cin.tie(0),cout.tie(0);
取消c++輸入輸出兼容c,解除輸入輸出流的綁定,使c++輸入輸出與c語言有著等效的效率(不會(huì)在一些題目因?yàn)閏in,cout而超時(shí))
詳細(xì)參考:https://blog.csdn.net/u014665013/article/details/70521300
using namespace std;
使用命名空間,c++頭文件,配合iostream
typedef long long ll;
簡化long long 類型的書寫為ll
浙公網(wǎng)安備 33010602011771號(hào)