演算法常用庫與函式[持續更新]
阿新 • • 發佈:2022-03-30
#include<bits/stdc++.h>
常用萬能標頭檔案
#include<iostream>
全名 input /output stream:輸入輸出流
#include <algorithm>
演算法庫的函式
#include <cstring> #include <string.h>
這兩個程式碼在做演算法的時候作用等價
詳細可以參考:https://blog.csdn.net/zollty/article/details/7291889
#include <cstdio>
#include <stdio.h>
同理,詳細請參考:https://blog.csdn.net/weixin_44703894/article/details/117876697
#include <vector> //集合,可變長陣列 #include <map>//表,鍵值對 #include <queue>//佇列,先入先出 #include <stack>//棧,先入後出 #include <set>//集合,不重複
ios::sync_with_stdio(false), cin.tie(0);
取消c++輸入輸出相容c,使c++輸入輸出與c語言有著等效的效率(不會在一些題目因為cin,cout而超時)
詳細參考:https://blog.csdn.net/u014665013/article/details/70521300
using namespace std;
使用名稱空間,c++標頭檔案,配合iostream
typedef long long ll;
簡化long long 型別的書寫為ll