随笔分类 - 模板
摘要:GDFZOJ原题地址戳这儿 洛谷原模板题戳这儿 这是一道$Dp$的模板题,也没什么好说的,直接开始吧 一、审题 有N件物品和一个容量为$V$的背包。第$i$件物品所占空间是$C_i$,价值是$W_i$。求解将哪些物品装入背包可使价值总和最大。 数据范围:$0 \le V \le 1000,0\le
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; const int maxn = 1e5+5; class bign { private: int d[maxn], len; public: void clean() { while(len>1&&!d[le
阅读全文
摘要:桥 #include<bits/stdc++.h> using namespace std; int n,m,cnt,tot,root,head[1005],dfn[1005],low[1005],f[1005]; bool flag[1005]; struct edge{ int to,nxt;
阅读全文
摘要:加法 // luogu-judger-enable-o2 #include <bits/stdc++.h> using namespace std; int main() { char a1[1000],b1[1000]; int a[1000]= {0},b[1000]= {0},c[1000]=
阅读全文
摘要:#include<bits/stdc++.h> using namespace std; int a,b,c,d; // int head[1000001]; int cnt; struct node{ int nxt,to; void read() { int u,v; scanf("%d%d",
阅读全文
摘要:个人收集的,应该没有什么遗漏的 #include <algorithm> #include <bitset> #include <cctype> #include <cerrno> #include <clocale> #include <cmath> #include <complex> #inc
阅读全文
摘要:倍增 #include<bits/stdc++.h> using namespace std; int n,m,u,v,r,cnt,head[500005],f[500005][22],dep[500005]; struct abc{ int to,nxt; }e[1000005]; void ad
阅读全文

浙公网安备 33010602011771号