会员
众包
新闻
博问
闪存
赞助商
HarmonyOS
Chat2DB
所有博客
当前博客
我的博客
我的园子
账号设置
会员中心
简洁模式
...
退出登录
注册
登录
gwj1139177410
博客园
首页
新随笔
联系
订阅
管理
上一页
1
···
23
24
25
26
27
28
29
30
31
···
50
下一页
2018年5月30日
【HAOI2008】【BZOJ1045】糖果传递(环形纸牌均分)
摘要: problem一个有n个数的环每次只能向相邻的数移动,移动一个数代价为1求让所有数相等的最小代价solution一:思路 1、纸牌均分问题每行答案是∑i=1n|i∗T/n−G[i]|" role="presentation" ...
阅读全文
posted @ 2018-05-30 12:31 gwj1139177410
阅读(158)
评论(0)
推荐(0)
2018年5月29日
【codevs1004】四子连棋
摘要: problemsolutioncodes//思路:把空白当棋,交替黑白走。//实现:BFS, 打表判断是否成立#include#include#include#includeusing namespace std;string s;struct node{ st...
阅读全文
posted @ 2018-05-29 21:38 gwj1139177410
阅读(120)
评论(0)
推荐(0)
【NOIP2001】【codevs1039】数的划分
摘要: problemsolutioncodes//step1:把n个苹果放到m个盘子里,不允许有空盘。等价于每个盘子放一个苹果先允许有空盘//step2:f[i][j]表示i个苹果j个盘子的放法数目//step3:转移,j>i时,去掉空盘不影响结果; jusing name...
阅读全文
posted @ 2018-05-29 21:33 gwj1139177410
阅读(136)
评论(0)
推荐(0)
【codevs1220】数字三角形
摘要: problemsolutioncodes//f[i][j]:从(i,j)出发能获得的最大值 _裸DFS#include#includeusing namespace std;int n, a[110][110], f[110][110];int dfs(int i, ...
阅读全文
posted @ 2018-05-29 21:31 gwj1139177410
阅读(160)
评论(0)
推荐(0)
【NOIP1997】【codevs1219】骑士游历
摘要: problemsolutioncodes//bugs:行列弄反(x,y是坐标轴...)+longlong#includeusing namespace std;typedef long long LL;LL n, m, x1, y1, x2, y2, f[55][55...
阅读全文
posted @ 2018-05-29 21:29 gwj1139177410
阅读(234)
评论(0)
推荐(0)
【NOIP2002】【codevs1010】过河卒
摘要: problemsolutioncodes//填表法#includeusing namespace std;int n, m, x, y, a[20][20], f[20][20];int main(){ cin>>n>>m>>x>>y; x++;y++;n++;...
阅读全文
posted @ 2018-05-29 21:27 gwj1139177410
阅读(143)
评论(0)
推荐(0)
【Codevs3027】线段覆盖2
摘要: problemsolutioncodes//f[i]:到第i条线段为止能获得的最大价值//f[i]=max{s[i].c,f[j]+s[i].c|j#includeusing namespace std;const int maxn = 1010;struct seg...
阅读全文
posted @ 2018-05-29 21:25 gwj1139177410
阅读(108)
评论(0)
推荐(0)
【NOIP2001】【Luogu1049】装箱问题
摘要: problemsolutioncodes//数据太水,搜索就好#include#includeusing namespace std;int n, m, a[110];int search(int i, int r){ if(i == n)return r; ...
阅读全文
posted @ 2018-05-29 21:23 gwj1139177410
阅读(113)
评论(0)
推荐(0)
【POJ1679】The Unique MST(非严格次小生成树)
摘要: problem给出一个连通无向图,判断它的最小生成树是否唯一如果唯一,输出生成树的大小,否则输出”Not Unique!”solution直接求非严格次小生成树如果次小生成树等于最小生成树则说明最小生成树不唯一,否则最小生成树一定是唯一的vector会TLE。。。co...
阅读全文
posted @ 2018-05-29 21:15 gwj1139177410
阅读(118)
评论(0)
推荐(0)
【图论】最小生成树学习笔记
摘要: 一、主要算法Prim给定一张无向图,求它的最小生成树。初始时我们将s打上标记。对于每个未标记的点i,我们记f[i]表示i连向已标记的点的边中,边权(到生成树距离)的最小值。每次我们找到未标记的点中f最小的,将它打上标记并更新其余点的f值。时间复杂度O(n2),用堆维护...
阅读全文
posted @ 2018-05-29 12:30 gwj1139177410
阅读(138)
评论(0)
推荐(0)
上一页
1
···
23
24
25
26
27
28
29
30
31
···
50
下一页
公告
选择
第七项
第六项
第一项
第二项
第三项
第四项