找回密码
 注册
快捷导航
查看: 1299|回复: 15

现在连要写个程序都卡在命题上了。我恨英语!

[复制链接] |自动提醒
阅读字号:

494

回帖

0

积分

2157

资产值

入门会员 Rank: 1

注册时间
2005-7-6
发表于 2006-3-8 21:23:47| 字数 1,180| - 中国–浙江–杭州 联通/浙江大学城市学院 | 显示全部楼层 |阅读模式
本来还打算参加浙江的什么编程大赛的选拔的
看了第二道题目我就放弃了
全是英文命题……
谁受得了啊,我光是看懂题目就要查半个小时字典了

题目是:
Suppose that we have a square city with straight streets. A map of a city is a square board with n rows and n columns, each representing a street or a piece of wall.

A blockhouse is a small castle that has four openings through which to shoot. The four openings are facing North, East, South, and West, respectively. There will be one machine gun shooting through each opening.

Here we assume that a bullet is so powerful that it can run across any distance and destroy a blockhouse on its way. On the other hand, a wall is so strongly built that can stop the bullets.

The goal is to place as many blockhouses in a city as possible so that no two can destroy each other. A configuration of blockhouses is legal provided that no two blockhouses are on the same horizontal row or vertical column in a map unless there is at least one wall separating them. In this problem we will consider small square cities (at most 4x4) that contain walls through which bullets cannot run through.

The following image shows five pictures of the same board. The first picture is the empty board, the second and third pictures show legal configurations, and the fourth and fifth pictures show illegal configurations. For this board, the maximum number of blockhouses in a legal configuration is 5; the second picture shows one way to do it, but there are several other ways.

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有账号?注册

x

494

回帖

0

积分

2157

资产值

入门会员 Rank: 1

注册时间
2005-7-6
 楼主| 发表于 2006-3-8 21:25:16| 字数 681| - 中国–浙江–杭州 联通/浙江大学城市学院 | 显示全部楼层
Your task is to write a program that, given a description of a map, calculates the maximum number of blockhouses that can be placed in the city in a legal configuration.

The input file contains one or more map descriptions, followed by a line containing the number 0 that signals the end of the file. Each map description begins with a line containing a positive integer n that is the size of the city; n will be at most 4. The next n lines each describe one row of the map, with a '.' indicating an open space and an uppercase 'X' indicating a wall. There are no spaces in the input file.

For each test case, output one line containing the maximum number of blockhouses that can be placed in the city in a legal configuration.

Sample input:

4
.X..
....
XX..
....
2
XX
.X
3
.X.
X.X
.X.
3
...
.XX
.XX
4
....
....
....
....
0

Sample output:

5
1
5
2
4
回复 支持 反对

使用道具 举报

396

回帖

0

积分

2618

资产值

入门会员 Rank: 1

注册时间
2006-2-19
发表于 2006-3-8 21:28:13| 字数 9| - 中国–浙江–杭州–临安区 电信 | 显示全部楼层
为什么要英文命题?
一生一世、平平安安
回复 支持 反对

使用道具 举报

8972

回帖

1

积分

7654

资产值

禁止访问

注册时间
2004-10-17
发表于 2006-3-8 21:54:23| 字数 9| - 中国–浙江–杭州 华数 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

494

回帖

0

积分

2157

资产值

入门会员 Rank: 1

注册时间
2005-7-6
 楼主| 发表于 2006-3-8 22:24:30| 字数 76| - 中国–浙江–杭州 联通/浙江大学城市学院 | 显示全部楼层
翻译了许久……终于弄明白题目***什么意思了。
烦恼啊~~~~为什么我要天天学英语?!?!
四级麻才365分,6月份要重考。
哎……大学生活就浪费在英语上了。
回复 支持 反对

使用道具 举报

5657

回帖

0

积分

718

资产值

入门会员 Rank: 1

注册时间
2005-11-13
发表于 2006-3-8 22:36:59| 字数 63| - 中国–浙江–宁波 电信 | 显示全部楼层
哈哈 我们考试的时候4级才100分的说,现在都365了阿
怎么搞得跟托福一样了阿

楼主 大学什么都可以不学
英语和专业课还是必须要学好的
淡定前进....
回复 支持 反对

使用道具 举报

4090

回帖

53

积分

5万

资产值

钻石会员 Rank: 3Rank: 3Rank: 3

注册时间
2003-7-4
铜牌荣誉勋章(注册8年以上会员)银牌荣誉勋章(注册10年以上会员)
发表于 2006-3-8 22:55:28| 字数 5| - 中国–浙江–杭州 电信 | 显示全部楼层
英语第一啊
从杭州起跳的青蛙
Pro 2.13GHZ 2G 120G
回复 支持 反对

使用道具 举报

8972

回帖

1

积分

7654

资产值

禁止访问

注册时间
2004-10-17
发表于 2006-3-8 22:57:50| 字数 24| - 中国–浙江–杭州 华数 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

1万

回帖

99

积分

3358

资产值

至尊会员I Rank: 4Rank: 4Rank: 4Rank: 4

注册时间
2003-3-26
铜牌荣誉勋章(注册8年以上会员)
发表于 2006-3-8 23:33:15| 字数 129| - 中国–浙江–温州–平阳县 电信 | 显示全部楼层
QUOTE:
原帖由 alongshidan 于 2006-3-8 22:36 发表
哈哈 我们考试的时候4级才100分的说,现在都365了阿
怎么搞得跟托福一样了阿

楼主 大学什么都可以不学
英语和专业课还是必须要学好的



这点我同意~
以前是学会数理化,走遍天下都不怕
现在要改说英文了
2009.03.04 今天刚订了DELL的机器,偶发现自己很猥琐~
回复 支持 反对

使用道具 举报

5881

回帖

2

积分

8170

资产值

初级会员 Rank: 1

注册时间
2005-3-7
发表于 2006-3-9 08:21:16| 字数 16| - 中国–浙江–嘉兴–海盐县 移动 | 显示全部楼层
偶也讨厌英语!!
偶也是英文盲!!
镜面无线S30(P3600256M80G54Mwifi日改英键盘原装电池5小时3com伸缩性网卡CF蓝牙全新日文键盘备用视频线)
回复 支持 反对

使用道具 举报

142

回帖

0

积分

226

资产值

入门会员 Rank: 1

注册时间
2005-2-22
发表于 2006-3-9 08:45:43| 字数 17| - 美国 科尔比学院 | 显示全部楼层
这题目的英文不是老外自己写的吧??
回复 支持 反对

使用道具 举报

532

回帖

0

积分

3085

资产值

入门会员 Rank: 1

注册时间
2005-6-11
铜牌荣誉勋章(注册8年以上会员)银牌荣誉勋章(注册10年以上会员)
发表于 2006-3-9 09:45:27| 字数 31| - 中国–浙江–舟山 电信 | 显示全部楼层
lz,英语很重要的。就算以后工作了用不大着,但是学还是要学的。
回复 支持 反对

使用道具 举报

3394

回帖

42

积分

7939

资产值

钻石会员 Rank: 3Rank: 3Rank: 3

注册时间
2005-4-23
铜牌荣誉勋章(注册8年以上会员)银牌荣誉勋章(注册10年以上会员)铜牌荣誉勋章(注册8年以上会员)金牌荣誉勋章(注册20年以上会员)
发表于 2006-3-9 10:15:14| 字数 27| - 中国–浙江–杭州 移动 | 显示全部楼层
我英语也不行啊,现在看MOTO,NOKIA 等的资料头大
回复 支持 反对

使用道具 举报

1万

回帖

2

积分

1万

资产值

禁止访问

注册时间
2004-10-30
发表于 2006-3-9 19:21:15| 字数 12| - 中国–浙江–杭州 华数 | 显示全部楼层
提示: 作者被禁止或删除 内容自动屏蔽
回复 支持 反对

使用道具 举报

5657

回帖

0

积分

718

资产值

入门会员 Rank: 1

注册时间
2005-11-13
发表于 2006-3-9 19:24:57| 字数 22| - 中国–浙江–宁波 联通 | 显示全部楼层
。。。。看来只有我喜欢看英文阿
订单都是英文的
淡定前进....
回复 支持 反对

使用道具 举报

9083

回帖

4

积分

1万

资产值

初级会员 Rank: 1

注册时间
2005-9-11
发表于 2006-3-9 19:28:05| 字数 46| - 中国–浙江–杭州 电信 | 显示全部楼层
英语这玩意儿不好说
目前的形势下
不学吧,往上攻读学位绝对没门
学了吧,好多人出学校以后基本用不上
定位坐标: 47°42'2.51"N,132°31'25.32"E
只爱小机器:X32-AEC;X60-47C
下一目标:带T的X
回复 支持 反对

使用道具 举报

您需要登录后才可以回帖 登录 | 注册

本版积分规则

Powered by Discuz! X3.5 © 2001-2023 Comsenz Inc

GMT+8, 2025-11-10 12:40 , Processed in 0.128615 second(s), 52 queries , Gzip On, OPcache On.

手机版|小黑屋|安卓客户端|iOS客户端|Archiver|备用网址1|备用网址2|在线留言|专门网

返回顶部