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

2012年9月5日

POJ 1270
摘要: dfs输出原图所有拓扑序就行了。#include<cstdio>#include<cstring>#include<cctype>using namespace std;int d[30],head[30],nc,n;struct edge{ int to,next;}edge[200];void add(int a,int b){ edge[nc].to=b;edge[nc].next=head[a];head[a]=nc++;}char ans[30];void dfs(int k){ if(k==n) { puts(ans); retu... 阅读全文
posted @ 2012-09-05 20:49 tmeteorj 阅读(379) 评论(0) 推荐(0)
 
POJ 1695
摘要: 直接DP,做完看别人说是用类似于双调欧几里得旅行商问题一样的方法解,仔细一看我的代码,貌似也和那旅行商问题做法差不多~~这题坑爹之处在于,不能用floyd去优化,也就是说说好了从a到c是99,然后你不能靠先到b再到c来优化。。View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<queue> 4 using namespace std; 5 int cos[50][50],dp[2][33][33][33]; 6 struct data 7 { 8 int x,y,z; 9 data() {} 阅读全文
posted @ 2012-09-05 20:22 tmeteorj 阅读(275) 评论(0) 推荐(1)
 
POJ 2584
摘要: 裸的最大流View Code 1 #include<cstdio> 2 #include<cstring> 3 #include<algorithm> 4 using namespace std; 5 const int N=2000,M=10000; 6 const int inff=1<<29; 7 int head[N],nc; 8 struct edge 9 { 10 int x,y,next; 11 int cap; 12 } edge[M*3]; 13 void add(int x,int y,int cap) 14 { 15 edg 阅读全文
posted @ 2012-09-05 19:10 tmeteorj 阅读(172) 评论(0) 推荐(0)
 
 

公告


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