摘要:
Task.hpp: #include<functional> class Task{ public: using func_t=std::function<std::string(int,int,char)>; Task(){} Task(const func_t &fun,const int &x 閱讀全文
摘要:
洛谷p4014 #include<bits/stdc++.h> using namespace std; const int N=120; const int M=N*N+(N<<1); struct edge{int v,c,w,ne;}e[M]; int h[N],id=1; int n,s,t 閱讀全文
摘要:
#include<iostream> #include<cstdio> #include<cmath> #include<cstring> using namespace std; #define LL long long #define N 510 #define INF 1e12 int n,m 閱讀全文
摘要:
假設(shè)我們把特殊點(diǎn)分成 A,B 兩個(gè)集合,新建 s 連 A 集合的所有點(diǎn),邊權(quán) 0 ,新建 t 連接 B 集合里的所有點(diǎn),邊權(quán) 0 ,那么 s 到 t 的最短路就是 A,B 集合點(diǎn)之間的最短路的最小值。 那么對于 k 個(gè)特殊點(diǎn),我們枚舉二進(jìn)制里的第 i 位,把二進(jìn)制第 i 位是 0 的點(diǎn)放在 A , 閱讀全文