当前你的浏览器版本过低,网站已在兼容模式下运行,兼容模式仅提供最小功能支持,网站样式可能显示不正常。
请尽快升级浏览器以体验网站在线编辑、在线运行等功能。

建议使用的浏览器:

谷歌Chrome 火狐Firefox Opera浏览器 微软Edge浏览器 QQ浏览器 360浏览器 傲游浏览器

2614:Beat

题目描述
Zty is a man that always full of enthusiasm. He wants to solve every kind of difficulty ACM problem in the world. And he has a habit that he does not like to solve
a problem that is easy than problem he had solved. Now yifenfei give him n difficulty problems, and tell him their relative time to solve it after solving the other one.
You should help zty to find a order of solving problems to solve more difficulty problem.
You may sure zty first solve the problem 0 by costing 0 minute. Zty always choose cost more or equal time’s problem to solve.
输入解释
The input contains multiple test cases.
Each test case include, first one integer n ( 2< n < 15).express the number of problem.
Than n lines, each line include n integer Tij ( 0<=Tij<10), the i’s row and j’s col integer Tij express after solving the problem i, will cost Tij minute to solve the problem j.
输出解释
For each test case output the maximum number of problem zty can solved.


输入样例
3
0 0 0
1 0 1
1 0 0
3
0 2 2
1 0 1
1 1 0
5
0 1 2 3 1
0 0 2 3 1
0 0 0 3 1
0 0 0 0 2
0 0 0 0 0
输出样例
3
2
4
提示
Hint: sample one, as we know zty always solve problem 0 by costing 0 minute. 
So after solving problem 0, he can choose problem 1 and problem 2, because T01 >=0 and T02>=0. 
But if zty chooses to solve problem 1, he can not solve problem 2, because T12 < T01. 
So zty can choose solve the problem 2 second, than solve the problem 1.  
来自杭电HDUOJ的附加信息
Author yifenfei
Recommend yifenfei

该题目是Virtual Judge题目,来自 杭电HDUOJ

题目来源 奋斗的年代

源链接: HDU-2614

最后修改于 2020-10-25T22:55:13+00:00 由爬虫自动更新

共提交 0

通过率 --%
时间上限 内存上限
6000/2000MS(Java/Others) 32768/32768K(Java/Others)