05 2021 档案
摘要:树形dp 其实可以剪纸的 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 5 int n,m; 6 7 int head[1010],nxt[1010],to[1010]; 8 int dp[1010][1010]; 9 //根节点为i,耗费
阅读全文
摘要:关于欧拉回路 若为有向图 每个点入度==出度 则存在欧拉回路 若为无向图 每个点所连边为偶数 则存在欧拉回路 看上去很好理解 但是在处理实际问题时 往往要用到并查集/map,和很棘手的操作 有几道题,推一下 [1] (https://www.luogu.com.cn/problem/P1341) 1
阅读全文
摘要:by luogu 我们将它用dp的思想来推一下 再进一步思考 可以发现 斐波那契! 再利用上矩阵递推 (我打印出来了1~12的ans、并找到了规律 1 #include<bits/stdc++.h> 2 3 4 #define M 1000000007 5 #define int long long
阅读全文
摘要:1 #include<bits/stdc++.h> 2 3 using namespace std; 4 int f[100001]; 5 int a[100001]; 6 7 struct node 8 { 9 int x,y,z; 10 }b[100001]; 11 12 int find(in
阅读全文
摘要:很明显的拓扑 推一波: https://www.luogu.com.cn/blog/Hehe-0/p2017-dizzy-cows-g 1 #include<bits/stdc++.h> 2 3 4 using namespace std; 5 const int mmm=1e6+1; 6 7 in
阅读全文
摘要:... 很明显的一个强连通分量的(水)题 当我看到题面时,想到了很多邪门做法,但应该不可行 此题 统计大小,和牛的关系 出度为0的是明星 id新号,a是出度 1 #include<bits/stdc++.h> 2 3 using namespace std; 4 const int mmm=5e4+
阅读全文

浙公网安备 33010602011771号