摘要:
题意:方格n*m,然后对于每一个格子有3种画法1左对角线2右对角线3不画,求让图形稳定的画法有多少种? 思路:通过手画二分图可以发现当二分图联通时改图满足条件,然后我们对于一个dp[n][m]可以利用容器原理先得到所有情况,然后减去不满足情况,那么以一点为中心,假设该点所在的连通块为dp[i][j] 阅读全文
摘要:
最主要的步骤是用 1式子和2式子推 3式子。(难点,看了很多博客最后的时候那个式子看不懂) 阅读全文
摘要:
#include using namespace std; bool noway[20][20], Gra[20][20]; int arr[20]; int linker[20]; bool used[20]; bool dfs(int u, int vN) { for(int v = 1; v <= vN; v++) if(Gra[u][v] && !used[v... 阅读全文
摘要:
RMQ存的是区间GCD,然后遍历 i: 1->n, 然后不断地对[i, R]区间进行二分求以i为起点的相同gcd的区间范围,慢慢缩减区间。 阅读全文
摘要:
#include using namespace std; const int maxn = 1007; char str[maxn][maxn]; int cntx[maxn], cnty[maxn],x[maxn],y[maxn]; int main(void){ int T,n,m;scanf("%d",&T); while(T --){ scanf("... 阅读全文
摘要:
#include #define bit(t) (1 = 0; i --){ if(sta & bit(i)) for(int j = i - 1; j >= 0; j --){ if(sta & bit(j))continue; int tmp = sta; ... 阅读全文
摘要:
#include using namespace std; struct node{ int u, v, w, nex; bool gone; node(){} node(int a,int b,int c){ u = a;v = b;w = c;gone = false; } bool operator >mp[maxP];... 阅读全文