摘要: 背包问题 01背包 AcWing 2. 01背包问题 二维: #include<bits/stdc++.h> using namespace std; typedef pair<int,int> PII; typedef long long ll; const int N=1e3+5; int n, 阅读全文
posted @ 2023-02-06 23:07 bible_w 阅读(11) 评论(0) 推荐(0) 编辑
摘要: Day 1 蓝桥杯模拟赛 3 A-[蓝桥杯 2021 省 B2] 特殊年份 思路:直接比较每个数的个十百千位 #include<bits/stdc++.h> using namespace std; const int N=1e5+5,M=2e5+5,INF=0x3f3f3f3f; int s[5] 阅读全文
posted @ 2023-02-06 19:39 bible_w 阅读(14) 评论(0) 推荐(0) 编辑
摘要: 树与图的存储 邻接矩阵:g[a][b]存储边a→b 邻接表:对于每个点k,开一个单链表,存储k所有可以走到的点。h[k]存储这个单链表的头节点 int h[N],e[N],idx,ne[N]; //添加一条边a->b void add(int a,int b){ e[idx]=b,ne[idx]=h 阅读全文
posted @ 2023-02-06 00:15 bible_w 阅读(10) 评论(0) 推荐(0) 编辑