• 博客园logo
  • 会员
  • 众包
  • 新闻
  • 博问
  • 闪存
  • 赞助商
  • HarmonyOS
  • Chat2DB
    • 搜索
      所有博客
    • 搜索
      当前博客
  • 写随笔 我的博客 短消息 简洁模式
    用户头像
    我的博客 我的园子 账号设置 会员中心 简洁模式 ... 退出登录
    注册 登录
tmeteorj
Nothing is so big that it is impossible to get over, and hurt only serves to make us stronger. 没有什么事是大到无法战胜的,痛苦也只会让我们变得更加坚强。
博客园 | 首页 | 新随笔 | 新文章 | 联系 | 订阅 订阅 | 管理

2012年9月15日

POJ 3275
摘要: 题意:将n头牛产奶速度又快到慢排序,已经比较了m对牛,问还至少需要多少次比较。题解:n头牛如果排序完成,应该有C(n,2)关系已知,即任意两头牛的速度都知道了。然后可以从已经比较了的m对牛中算出可以推导出多少对牛已经知道了,推导方法可以参考floyd最短路,然后用C(n,2)减去它就是答案。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 int head[2][1005],nc[2]; 6 struct Edge 7 阅读全文
posted @ 2012-09-15 20:21 tmeteorj 阅读(408) 评论(0) 推荐(0)
 
POJ 3050
摘要: 题意:问从5*5的矩阵中选连续的6个组成的字符串有多少种题解:dfsView Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 #include<set> 5 using namespace std; 6 int map[6][6]; 7 set<int> ss; 8 void dfs(int x,int y,int res,int k) 9 {10 if(k==6)11 {12 ss.insert(res);13 return;14 }15 ... 阅读全文
posted @ 2012-09-15 19:22 tmeteorj 阅读(479) 评论(0) 推荐(0)
 
 

公告


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