摘要:
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 阅读全文
摘要:
假设我们把特殊点分成 A,B 两个集合,新建 s 连 A 集合的所有点,边权 0 ,新建 t 连接 B 集合里的所有点,边权 0 ,那么 s 到 t 的最短路就是 A,B 集合点之间的最短路的最小值。 那么对于 k 个特殊点,我们枚举二进制里的第 i 位,把二进制第 i 位是 0 的点放在 A , 阅读全文