02 2017 档案
摘要:luoguvijos两种方法一、带权并查集:问题 front做差#include#include #include#include#include#include#include#includeusing namespace std;int f[50001],front[50000...
阅读全文
摘要:设置两个数组来记录后面的长度和前面的长度#include#include #include#include#include#include#include#includeusing namespace std;int behind[30010],front[30010],f[300...
阅读全文
摘要:朴素并查集#include#include#include#include#include#include#includeusing namespace std;int n,m;vector dr[1001];int py[1001];int findpy(int x){ ...
阅读全文
摘要:题见洛谷最小生成树prim 并点#include#include#include#include #includeusing namespace std;int tu[101][101],dis[101],a[101];int main(){ //freopen("a.i...
阅读全文
摘要:Page 527 出现的 大 错误:ans[ ] 内的数不是一个一个挨着放进去的 !而是按照扫到的范围的顺序放进去 #include<iostream> #include<cstdio> #include<cstring> #include<string> #include<algorithm> u
阅读全文
摘要:#include#include#include#include #includeint n,m;int f[10001];int tree[10001][301];int r[10001],ans=0;using namespace std;int main(){ scan...
阅读全文
摘要:题见洛谷#include#include#include#include #includeusing namespace std;int deep,n,maxl=0,anst=999999;struct H{ int tim,tall,last;}st[200];int f[...
阅读全文
摘要:题见洛谷#include#include#include#include #includeusing namespace std;long long ans=0;int a[300],n,f[300][300];int main(){ scanf("%d",&n); f...
阅读全文
摘要:题见洛谷由于依赖少 , 可以改为分组背包 #include#include#include#include #includeusing namespace std;int v[210],c[210],n,m,wj[210][3],wpv[210],wpc[210]; int f[...
阅读全文
摘要:题见洛谷记忆化搜索#include#include#include#include #includeusing namespace std;int num[5],a0[400];int dp[40][40][40][40],ans=0;int n,m;int dfs(int x,i...
阅读全文
摘要:题见洛谷#include#include#include#include#include#include#define LL long longusing namespace std;bool lief[10][10],hangf[10][10],gef[10][10];int a...
阅读全文
摘要:题见洛谷位运算版(设计巧妙,需要回顾,加深理解)#include#include#include#include#include#include#includeusing namespace std;int a[20];int ans=0,uplimit,n;void print(...
阅读全文
摘要:#include#include#include#include#include#includeusing namespace std;int ans[200][200];int tall[200][200];int dx[]={0,1,-1,0,0};int dy[]={0,0,...
阅读全文
摘要:题见洛谷 带有技巧的搜索,用到杨辉三角形 不难看出 第几个(k)拆的数(虽说并不是拆的),系数为杨辉三角第n行,第k列的数字#include#include#include#include#include#includeusing namespace std;int n,sum...
阅读全文
摘要:题见洛谷#include#include#include#include#include#include#includeusing namespace std;int a[40][40],n;bool f[40][40];int dx[]={0,1,-1,0,0};int dy[]...
阅读全文
摘要:题见洛谷#include#include#include#include#include#include#includebool f[1005][1005];char a[1005][1005];int dx[]={0,0,0,1,-1};int dy[]={0,1,-1,0,0}...
阅读全文
摘要:题见洛谷#include#include#include#include#include#include#include#define LL long long#define p 0.00000001using namespace std;int n,k;int pos[10000...
阅读全文
摘要:总时间限制: 3000ms 内存限制: 65536kB 【】描述 给出4个小于10个正整数,你可以使用加减乘除4种运算以及括号把这4个数连接起来得到一个表达式。现在的问题是,是否存在一种方式使得得到的表达式的结果等于24。这里加减乘除以及括号的运算结果和运算的优先级跟我们平常的定义...
阅读全文
摘要:题目#include#include#include#include#include#include#define LL long longusing namespace std;int lief[10][10],hangf[10][10],gef[10][10];int quan...
阅读全文
摘要:高精加 压位#include#include#include#include#include#include#define LL long longusing namespace std;int a[1000],b[1000],c[1000];char s1[1001],s2[10...
阅读全文
摘要:1.枚举 2.前缀和维护 差值维护(详见上一篇) 3.最大字段和for (i=1; ip) t--; ans=max(ans,a[i]+b[t]); }6.折半搜索 (这个我也不会)直接贴标程、、、、折半搜索+two point体积之和m) t--; if (t) ...
阅读全文
摘要:比线段树慢但是简洁一维差值维护对a数组进行m次操作,每次在l~r上加不同的值,最后输出ql~qr的区间和cha[i]=a[i]-a[i-1];//差值cha[l]+=k,cha[r+1]-=k;//差值维护//那么m次操作后a[i]=∑cha[1~i];s[i]=∑a[1~i];a...
阅读全文

浙公网安备 33010602011771号