摘要:
题目传送门 现在看来熊猫杯的J题原来是个容斥套路题,按照值域排序后根据值域划分方块数,枚举子集容斥计算即可。 #include<cstdio> #include<algorithm> using namespace std; const int p = 1e9 + 7; const int N = 阅读全文
摘要:
#include<cstdio> #include<cmath> #include<algorithm> using namespace std; typedef long long ll; typedef double db; const db Pi = acos(-1); const db in 阅读全文
摘要:
题目传送门 一道很好的状压DP,状态是当前的占位情况,排序操作和第21次CSP认证的第四题作用类似。 #include<cstdio> #include<vector> #include<algorithm> using namespace std; typedef long long ll; co 阅读全文
摘要:
参考博客 #include<cstdio> typedef long long ll; const int N = 2e5 + 50; int n, cnt, top, tot; int c[N], mindiv[N], dep[N], w[N]; int head[N], sta[N], lca_ 阅读全文