| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 693 人关注过本帖
标题:有一些题的讨论。有信心的请入。
取消只看楼主 加入收藏
dongshimou
Rank: 3Rank: 3
等 级:论坛游侠
威 望:2
帖 子:44
专家分:152
注 册:2014-1-8
结帖率:100%
收藏
已结贴  问题点数:20 回复次数:3 
有一些题的讨论。有信心的请入。
抱着侥幸心态去参加了学校的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

搜索更多相关主题的帖子: 二进制 网络 学校 
2014-04-27 19:48
dongshimou
Rank: 3Rank: 3
等 级:论坛游侠
威 望:2
帖 子:44
专家分:152
注 册:2014-1-8
收藏
得分:0 
回复 2 楼 嗜血老妖
知道是BFS。我卡在判重了。学长说的什么方法没听明白,只是到哈希表可以。
求哈希表的写法。正确的说是本题哈希表判重的写法。
2014-04-27 20:24
dongshimou
Rank: 3Rank: 3
等 级:论坛游侠
威 望:2
帖 子:44
专家分:152
注 册:2014-1-8
收藏
得分:0 
回复 5 楼 azzbcc
开始也这样想过(数最大也就10e9),但是还是没过。
2014-04-27 23:04
dongshimou
Rank: 3Rank: 3
等 级:论坛游侠
威 望:2
帖 子:44
专家分:152
注 册:2014-1-8
收藏
得分:0 
回复 7 楼 azzbcc
试试直接用链式。只要有不同就停止比较。
比如
只要比对到和终止状态有不同就停止。
感觉有点像是字典树了。

突发奇想是不是可以开一个九维数组。
a[1][2][3][0][4][6][7][5][8] 表示终止状态。
判重问题也解决了。
可是每次初始化就麻烦了。
2014-04-28 18:10
快速回复:有一些题的讨论。有信心的请入。
数据加载中...
 
   



关于我们 | 广告合作 | 编程中国 | 清除Cookies | TOP | 手机版

编程中国 版权所有,并保留所有权利。
Powered by Discuz, Processed in 0.043297 second(s), 8 queries.
Copyright©2004-2024, BCCN.NET, All Rights Reserved