| 网站首页 | 业界新闻 | 小组 | 威客 | 人才 | 下载频道 | 博客 | 代码贴 | 在线编程 | 编程论坛
欢迎加入我们,一同切磋技术
用户名:   
 
密 码:  
共有 5537 人关注过本帖
标题:第十八期编程比赛
只看楼主 加入收藏
crackerwang
Rank: 3Rank: 3
等 级:新手上路
威 望:8
帖 子:833
专家分:0
注 册:2007-2-14
收藏
 问题点数:0 回复次数:83 
第十八期编程比赛

比赛时间:周五 17:00----周六 17:000(时间很长的.先睡个觉,再出去逛一下都来的及)
比赛题目:
分两组:
基础题:(适合新人们动动脑.高手估计只要动动手就OK了.题目程序都不长.)

http://yzfy.org/bbs/forumdisplay.php?fid=12

分别是以bccn18做前缀的那个三个题目(也就是扇形面积,疯狂世界杯,逆序数2).

我选了几个最近做过的三个题目.把题目描述改成中文之后直接拿我提交通过的程序做标程.然后随机弄了些数据来给大家做.题目的一些陷阱都去掉了.(所以我也没有办法保证我的程序没有漏洞.本来想把测试地点直接放到OJ上去.发现太分散了.所以干脆借用一下某人的OJ,比赛结束之后也能相互看到别人的程序.方便大家提高嘛).

提高题:
哎!.是两个我不会的题目.希望高手来帮忙:

第一题:
http://acm.jlu.edu.cn/joj/showproblem.php?pid=2438

Level Up

--------------------------------------------------------------------------------
Status In/Out TIME Limit MEMORY Limit Submit Times Solved Users JUDGE TYPE
stdin/stdout 10s 32768K 173 19 Standard

The warrior will go through a labyrinth to help his princess. There are different kind of room in the labyrinth. The room may be block or empty. In other case, there are small or large monster in the room. At first, the warrior can only defeat the small monster but not large. After kill a certain number of small monsters, the capability of warrior will upgrade to defeat large monster.

The hero can move up, down, left or right. His objective is to go through the labyrinth quickly although some monster should be killed. Can you find the best path when the map of labyrinth is given? Of course, the dead monster can't revive.

Input
The first line of each case are the width and height of maze m,n (m,n <=8), and the integer k that is the number of monster should be killed to upgrade. At the next m lines, a string with length n is given to describle the labyrinth. In each string, a letter '.' means empty room, letter '#' means block room, the lowercase 'o' means small monster and uppercase 'O' means large monster. The entey of maze is left-top, and the exit is right-bottom.

Output
Output the best step in one line for each case. If there is no route, output -1.

Sample Input
4 4 3
o...
....
o.OO
o#O.
Sample Output
9

翻译一下:
第一题其实就是一个迷宫类似.就象我们warcraft一样开始英雄没有什么等级所以只能打小怪物.等升了之后才能打大的.题目就是一个8*8的格子.你的英雄在左上角.你要到左下角去.'.'代表没有怪物,'o'代表有小怪,'O'代表大怪,杀大怪必须至少杀k个小怪升级才能杀。'#'代表的是不能走的石头,

第二题:
http://acm.whu.edu.cn/oak/problem/problem.jsp?problem_id=1268


Problem 1268 - Game of Connections
Time Limit:1000MS Memory Limit:65536KB
Total Submit:15 Accepted:7
DescriptionThis is a small but ancient game. You are supposed to write down the numbers 1, 2, 3, . . . , 2n - 1, 2n consecutively in clockwise order on the ground to form a circle, and then, to draw some straight line segments to connect them into number pairs. Every number must be connected to exactly one another.
And, no two segments are allowed to intersect.
It's still a simple game, isn't it? But after you've written down the 2n numbers, can you tell me in how many different ways can you connect the numbers into pairs? Life is harder, right?
InputEach line of the input file will be a single positive number n, except the last line, which is a number -1.
You may assume that 1 <= n <= 100.
OutputFor each n, print in a single line the number of ways to connect the 2n numbers into pairs.
Sample Input
2
3
-1
Sample Output
2
5
翻译:
把1到2n按照顺序顺时针摆好.然后用线把两个数字连接起来,要求线段不能相交.问有多少种连接方法.每个数字只能连接一个数字

第一题当时比赛的时候也就3个人过了.后来我写了好多次都过不了.第二个应该是DP.可怜我水平烂还是不会.


[此贴子已经被作者于2007-9-14 21:56:21编辑过]

搜索更多相关主题的帖子: 世界杯 blank color 中文 时间 
2007-09-14 18:26
雨中飞燕
Rank: 3Rank: 3
等 级:禁止访问
威 望:8
帖 子:2200
专家分:0
注 册:2007-8-9
收藏
得分:0 
题目发好了,提交后一般只要等15秒就有测试结果了



by 雨中飞燕 QQ:78803110 QQ讨论群:5305909

[url=http://bbs.bc-cn.net/viewthread.php?tid=163571]请大家不要用TC来学习C语言,点击此处查看原因[/url]
[url=http://bbs.bc-cn.net/viewthread.php?tid=162918]C++编写的Windows界面游戏[/url]
[url=http://yzfy.org/]C/C++算法习题(OnlineJudge):[/url] http://yzfy.org/

[此贴子已经被作者于2007-9-14 18:37:34编辑过]

2007-09-14 18:35
ACKing
Rank: 1
等 级:新手上路
帖 子:69
专家分:0
注 册:2007-9-4
收藏
得分:0 
第一题搜应该可以,第二题是经典的卡特兰数,当然也可以dp
2007-09-14 19:14
死了都要C
Rank: 4
来 自:四川成都
等 级:贵宾
威 望:13
帖 子:1582
专家分:116
注 册:2006-12-7
收藏
得分:0 
我现在就去看```

女施主``我给你``送茶来了```师太``你就从了老衲吧``
代码本天成~~~妙头偶得之```
2007-09-14 20:23
卧龙孔明
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:59
帖 子:3872
专家分:684
注 册:2006-10-13
收藏
得分:0 
楼主能提供中文的译题吗?

My Blog: www.aiexp.info
虽然我的路是从这里开始的,但是这里不再是乐土.感谢曾经影响过,引导过,帮助过我的董凯,飞燕,leeco,starwing,Rockcarry,soft_wind等等等等.别了,BCCN.
2007-09-14 20:40
卧龙孔明
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:59
帖 子:3872
专家分:684
注 册:2006-10-13
收藏
得分:0 
现在我们数学还没学过弧度...看来第一题不能AC了

My Blog: www.aiexp.info
虽然我的路是从这里开始的,但是这里不再是乐土.感谢曾经影响过,引导过,帮助过我的董凯,飞燕,leeco,starwing,Rockcarry,soft_wind等等等等.别了,BCCN.
2007-09-14 20:47
crackerwang
Rank: 3Rank: 3
等 级:新手上路
威 望:8
帖 子:833
专家分:0
注 册:2007-2-14
收藏
得分:0 
以下是引用ACKing在2007-9-14 19:14:44的发言:
第一题搜应该可以,第二题是经典的卡特兰数,当然也可以dp

第二个应该是对的.
第一个搜这个回答是不是有点太广了...不如写一下把程序贴出来

或者提示一下,状态的纪录或者剪枝.

[此贴子已经被作者于2007-9-14 21:06:00编辑过]


2007-09-14 20:54
死了都要C
Rank: 4
来 自:四川成都
等 级:贵宾
威 望:13
帖 子:1582
专家分:116
注 册:2006-12-7
收藏
得分:0 
但是如果给你一个逆序数m和n。让你求由1到n的数字组成的一个逆序数为m排列呢?


LZ```看不懂啊`````
给翻译下```举个详细的列子```谢谢了````

女施主``我给你``送茶来了```师太``你就从了老衲吧``
代码本天成~~~妙头偶得之```
2007-09-14 20:55
雨中飞燕
Rank: 3Rank: 3
等 级:禁止访问
威 望:8
帖 子:2200
专家分:0
注 册:2007-8-9
收藏
得分:0 
以下是引用卧龙孔明在2007-9-14 20:47:07的发言:
现在我们数学还没学过弧度...看来第一题不能AC了

和弧度关系不大啊~~~~~~完全可以不管弧度。。。解一个超越方程而已



by 雨中飞燕 QQ:78803110 QQ讨论群:5305909

[url=http://bbs.bc-cn.net/viewthread.php?tid=163571]请大家不要用TC来学习C语言,点击此处查看原因[/url]
[url=http://bbs.bc-cn.net/viewthread.php?tid=162918]C++编写的Windows界面游戏[/url]
[url=http://yzfy.org/]C/C++算法习题(OnlineJudge):[/url] http://yzfy.org/

2007-09-14 20:56
卧龙孔明
Rank: 9Rank: 9Rank: 9
等 级:贵宾
威 望:59
帖 子:3872
专家分:684
注 册:2006-10-13
收藏
得分:0 
以下是引用雨中飞燕在2007-9-14 20:56:06的发言:

和弧度关系不大啊~~~~~~完全可以不管弧度。。。解一个超越方程而已

"弦长"又是什么


My Blog: www.aiexp.info
虽然我的路是从这里开始的,但是这里不再是乐土.感谢曾经影响过,引导过,帮助过我的董凯,飞燕,leeco,starwing,Rockcarry,soft_wind等等等等.别了,BCCN.
2007-09-14 20:59
快速回复:第十八期编程比赛
数据加载中...
 
   



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

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