上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页
摘要: 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 9 #define maxx 1<<2110 using namespace std;11 12 int mat[22][22],n,dp... 阅读全文
posted @ 2014-05-20 22:28 galaxy77 阅读(178) 评论(0) 推荐(0) 编辑
摘要: istringstream对象可以绑定一行字符串,然后以空格为分隔符把该行分隔开来。添加头文件 #include 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 char... 阅读全文
posted @ 2014-05-16 18:59 galaxy77 阅读(3140) 评论(0) 推荐(0) 编辑
摘要: 阅读全文
posted @ 2014-05-15 21:09 galaxy77 阅读(140) 评论(0) 推荐(0) 编辑
摘要: f[i][j]==true 代表 从i到j有 有向边相连1 for(int k=0;k<n;k++)2 for(int i=0;i<n;i++)3 if(f[i][k])4 for(int j=0;j<n;j++)5 ... 阅读全文
posted @ 2014-05-15 21:04 galaxy77 阅读(168) 评论(0) 推荐(0) 编辑
摘要: http://202.116.77.69/sicily/show_problem.php?pid=1866【题意】序列a 变成序列b 的最少步数 可执行的操作有 1. 把交换字符串的前两个字符 2. 把最前面的那个字符换到最后【思路】 广搜 但是有几个地方要注意的 1. ... 阅读全文
posted @ 2014-05-14 11:16 galaxy77 阅读(160) 评论(0) 推荐(0) 编辑
摘要: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3130【题意】: 给一个有向图 每条边有费用 求 s到e 的两条总花费最少的 完全没有交点的 路径【思路】:把每条路径 的容量赋值为1 于是每条边就只能添加一次了 再每次增广 ... 阅读全文
posted @ 2014-05-11 22:15 galaxy77 阅读(156) 评论(0) 推荐(0) 编辑
摘要: 学习了博客 http://www.cnblogs.com/dgsrz/articles/2791363.html首先把 (1 2 #include 3 #include 4 using namespace std; 5 6 #define INF 0x3f3f3f3f 7 int dp[1 =... 阅读全文
posted @ 2014-05-11 22:13 galaxy77 阅读(151) 评论(0) 推荐(0) 编辑
摘要: http://acm.hdu.edu.cn/showproblem.php?pid=3309 1 #include 2 #include 3 #include 4 #include 5 #include 6 using namespace std; 7 8 char s[30][3... 阅读全文
posted @ 2014-05-08 22:17 galaxy77 阅读(150) 评论(0) 推荐(0) 编辑
摘要: 参考了别人的思路dp[i][j]表示从第i个人到第j个人这段区间的最小花费是只考虑这j-i+1个人,不需要考虑前面有多少人)那么对于dp[i][j]的第i个人,、就有可能第1个上场,也可以第j-i+1个上场。考虑第K个上场即在i+1之后的K-1个人是率先上场的,那么就出现了一个子问题 dp[i+1]... 阅读全文
posted @ 2014-05-07 16:08 galaxy77 阅读(149) 评论(0) 推荐(0) 编辑
摘要: http://poj.org/problem?id=1088 1 #include 2 #include 3 #include 4 #include 5 using namespace std; 6 7 int d[102][102],a[102][102]; 8 int dis[4][2... 阅读全文
posted @ 2014-05-06 15:16 galaxy77 阅读(139) 评论(0) 推荐(0) 编辑
上一页 1 ··· 3 4 5 6 7 8 9 10 11 ··· 20 下一页