• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
HT008
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2017年10月26日

最大约数和
摘要: 预处理出每个数的约数和。 把每个数的大小看出质量,约数和看为价值,s为最大的背包质量。 这样就转化为01背包了 阅读全文
posted @ 2017-10-26 16:38 ht008 阅读(160) 评论(0) 推荐(0)
 
凌乱的YYY
摘要: "QAQ" 区间覆盖问题之最大不相交覆盖问题 这个问题可以用DP解决,也可以用贪心解决。 这里给出贪心做法。 把终点升序排列,模拟判断即可。 阅读全文
posted @ 2017-10-26 16:22 ht008 阅读(208) 评论(0) 推荐(0)
 
 

2017年10月25日

天上掉馅饼
摘要: 题目描述 小 G 进入了一个神奇的世界,在这个世界,天上会掉下一些馅饼。今天,天上 会随机掉下 k 个馅饼。 每次天上掉下馅饼,小 G 可以选择吃或者不吃(必须在下一个馅饼掉下来之前 作出选择,并且现在决定不吃的话以后也不能吃)。 馅饼有 n 种不同的馅,根据物理定律,天上掉下这 n 种馅饼的概率相 阅读全文
posted @ 2017-10-25 16:50 ht008 阅读(207) 评论(0) 推荐(0)
 
 

2017年3月1日

爱在心中(强连通分量)
摘要: QAQ#include #include #include using namespace std;int color[9999],c=0,num=0,low[9999],dfn[9999],top,f[9999],s[9999],fx[9999];int n,m,ans;int ... 阅读全文
posted @ 2017-03-01 15:12 ht008 阅读(182) 评论(0) 推荐(0)
 
 

2017年2月26日

食物链
摘要: 题目 很经典的并查集题目 反集做法:开三倍的数组,分别是吃x的和x吃的。#include #include #include using namespace std;const int MAXN=200000;int f1[MAXN];int find(int x)//找爸+路径... 阅读全文
posted @ 2017-02-26 10:43 ht008 阅读(210) 评论(0) 推荐(0)
 
 

2017年2月22日

银河英雄传说(带权并查集)(草稿)
摘要: 题目#include #include #include using namespace std;const int MAXN=31000;int f[MAXN],min1;int front[MAXN],behind[MAXN];int find(int x){ if(f[... 阅读全文
posted @ 2017-02-22 15:22 ht008 阅读(139) 评论(0) 推荐(0)
 
 

2017年2月19日

团伙
摘要: 题目#include #include #include using namespace std;int f1[2001],f[2001];int ff(int x) { if(f1[x]!=x) f1[x]=ff(f1[x]); return f1[x]; //... 阅读全文
posted @ 2017-02-19 09:04 ht008 阅读(122) 评论(0) 推荐(0)
 
 

2017年2月17日

数组模拟链表
摘要: #include #include #include #include using namespace std;int head[1000],next[1000],num[1000];int main(){ int n,m; scanf("%d%d",&n,&m); ... 阅读全文
posted @ 2017-02-17 17:42 ht008 阅读(88) 评论(0) 推荐(0)
 
 

2017年2月15日

最小生成树(prime)
摘要: #include #include #include using namespace std;int dis[1000],sum=0,f[1000],a[1001][1001],ans[1000][3],p[1000];int main(){ int n,m,t=0; ... 阅读全文
posted @ 2017-02-15 15:50 ht008 阅读(182) 评论(0) 推荐(0)
 
裸的tarjan(模板)
摘要: #include #include #include using namespace std;vector q[1000];int color[10000],c=0,num=0,low[1000],dfn[1000],top=0,f[1000],s[1000],maxf=-1;v... 阅读全文
posted @ 2017-02-15 15:48 ht008 阅读(141) 评论(0) 推荐(0)
 
 
下一页

公告


博客园  ©  2004-2025
浙公网安备 33010602011771号 浙ICP备2021040463号-3