05 2014 档案
摘要:【题意】 给出r行c列的个子矩阵, 给k个点。 求第一行, 最后一行, 第一列, 最后一列都放有点的方法数A 表示第一行没有放的集合 B 最后一行没有放的集合C 第一例没有放的集合D 最后一列没有放的集合在A,B里 相当一 少了一行 其方法数是 C[(r-1)*c][k] C,D里相当于 少了...
阅读全文
摘要:1 #include 2 #include 3 #include 4 5 int i,j,n,a,b,c,d,temp1,temp2,temp3,temp4,temp5,temp6; 6 char a1,c1; 7 8 void solve() 9 {10 temp1=a+b;1...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=4049【题意】 一群人 去n个城市旅游 每个城市有一个消费cost,每个人的cost 都相同。每个人i对城市j都有一个喜爱的值inter[i][j]。他们的路线及起点终点都已经确定。每一个人都有权中途离开队伍,或者...
阅读全文
摘要: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...
阅读全文
摘要:istringstream对象可以绑定一行字符串,然后以空格为分隔符把该行分隔开来。添加头文件 #include 1 #include 2 #include 3 #include 4 using namespace std; 5 6 int main() 7 { 8 char...
阅读全文
摘要: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 ...
阅读全文
摘要:http://202.116.77.69/sicily/show_problem.php?pid=1866【题意】序列a 变成序列b 的最少步数 可执行的操作有 1. 把交换字符串的前两个字符 2. 把最前面的那个字符换到最后【思路】 广搜 但是有几个地方要注意的 1. ...
阅读全文
摘要:http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=3130【题意】: 给一个有向图 每条边有费用 求 s到e 的两条总花费最少的 完全没有交点的 路径【思路】:把每条路径 的容量赋值为1 于是每条边就只能添加一次了 再每次增广 ...
阅读全文
摘要:学习了博客 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 =...
阅读全文
摘要: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...
阅读全文
摘要:参考了别人的思路dp[i][j]表示从第i个人到第j个人这段区间的最小花费是只考虑这j-i+1个人,不需要考虑前面有多少人)那么对于dp[i][j]的第i个人,、就有可能第1个上场,也可以第j-i+1个上场。考虑第K个上场即在i+1之后的K-1个人是率先上场的,那么就出现了一个子问题 dp[i+1]...
阅读全文
摘要: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...
阅读全文
摘要:http://poj.org/problem?id=1661 1 #include 2 #include 3 #include 4 #include 5 #include 6 #define INF 100000000 7 using namespace std; 8 9 int n,m,...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1676题意:有n个城市和m条路,一辆车要从s城市到e城市,而且这辆车能够乘的油的容量为cap,每走1单位距离就耗费1单位油。每个城市都有加油站,但是每个加油站的价格不同。让你判断这辆车能否到达城市e,如果能够达到,...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1023 1 #include 2 #include 3 #include 4 #include 5 #include 6 #include 7 #include 8 using namespace ...
阅读全文
摘要:http://acm.hdu.edu.cn/showproblem.php?pid=1023 1 //package dhsjdhjkh; 2 3 import java.util.*; 4 import java.io.*; 5 import java.math.BigInteger; 6 7...
阅读全文
摘要:http://acm.fzu.edu.cn/problem.php?pid=2171 Problem 2171 防守阵地 II Accept: 73Submit: 256Time Limit: 3000 mSecMemory Limit :...
阅读全文
浙公网安备 33010602011771号