有一些题的讨论。有信心的请入

抱着侥幸心态去参加了学校的ACM校赛。十一个题,AC了四道题,难题基本没做出来,可以做出来的D题被负数和空卡了。就是卡数据了,一直不停的RE和WA,浪费大把时间。F题二进制用斐波那契数列排列,结果我搞错排列,WA了几次就没去看了,时间太紧。H题的八数码问题本来用打算用哈希表判重,可是一直卡在这写不对。I题比赛完了跑去问大神,大神说是网络流问题,连题意都理解错的我真是悲剧。K题是线段树问题,比赛完了才想到,比赛时一直当作优先队列问题在做,于是WA是必然的。我贴出H题的题意和I题的题意,忘有大神能给于我解答,谢谢。

H:
Problem H: Can you get it?
Time Limit: 5 Sec Memory Limit: 512 MB

程序代码:

Description
      Jingkai Wang always ponder over things alone. So, his gay friend Jie Yang, ask him to play a interesting game which called Jiugong Arrangement. This game is very easy, the rules as follow. Gving you the begin status and the end status, you just need to find what is the minimum steps the begin status change to the end status. Surely, you can move 


Input
      The first line of input contains only one integer T ( 1 < = T < = 100 ) indicates the test cases, the following T cases.

       Each test has six lines, the previous three lines indicate the begin status and the next three lines indicate the end status.  

Output
The output only contains one number, indicate the minimum steps from the begin status to the end status. If there is impossible to change the begin status to end status, please output -1.


Sample Input
2
123
456
78.

123
.46
758

135
246
78.

467
581
23.

Sample Output
3
22

I题 :
Problem I: Love Toys
Time Limit: 2 Sec  Memory Limit: 512 MB

程序代码:

Description
     As the Math King in our ACM team, Tailong Wu want to give his girl-friend a surprise in her birthday. He plans to buy n toys to his girl-friend. The n toys can be made in m toy factories, and each toy factory may spend different

time making toys. Each toy only can be made completely in one factory. The production 

order of these toys can be random. Before the factory finishes one toy , it can’t make 

others. Now, his girl-friend’s birthday is coming, he wants to get the n toys as soon as possible.




Input
The input contains multiple test cases;

The first line of each test case contains two integers n ( 1 < = n < = 50 ), 

m ( 1 < = m < = 50 ), the following n lines, each line contains m integers Ci,j 

indicate the time which the ith spend Ci,j making the toy j.


Output
The output only contains one float time indicate the minimum average time he can buy 

the n toys. The result should be rounded to six decimal places.


Sample Input
3 4
100 100 100 1
99 99 99 1
98 98 98 1

3 4
1 100 100 100
99 1 99 99 
98 98 1 98

3 4
1 100 100 100
1 99 99 99
98 1 98 98

Sample Output
2.000000
1.000000
1.333333


评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值