Google编程大赛入围赛250分真题

Google编程大赛题目 Google编程大赛题目Google编程大赛题目Google编程大赛题目 立即下载


Problem Statement
????
You are given a String[] cityMap representing the layout of a city. The city
consists of blocks. The first element of cityMap represents the first row of
blocks, etc. A 'B' character indicates a location where there is a bus stop.
There will be exactly one 'X' character, indicating your location. All other
characters will be '.'. You are also given an int walkingDistance, which is the
maximum distance you are willing to walk to a bus stop. The distance should be
calculated as the number of blocks vertically plus the number of blocks
horizontally. Return the number of bus stops that are within walking distance of
your current location. Definition
????
Class:
BusStops
Method:
countStops
Parameters:
String[], int
Returns:
int
Method signature:
int countStops(String[] cityMap, int walkingDistance)
(be sure your method is public)
????

Constraints
-
cityMap will contain between 1 and 50 elements, inclusive.
-
Each element of cityMap will contain between 1 and 50 characters, inclusive.
-
Each element of cityMap will contain the same number of characters.
-
Each character of each element of cityMap will be 'B', 'X', or '.'.
-
There will be exactly one 'X' character in cityMap.
-
walkingDistance will be between 1 and 100, inclusive.
Examples
0)

????
{"...B.",
 ".....",
 "..X.B",
 ".....",
 "B...."}
3
Returns: 2
You can reach the bus stop at the top (3 units away), or on the right (2 units
away). The one in the lower left is 4 units away, which is too far. 1)

????
{"B.B..",
 ".....",
 "B....",
 ".....",
 "....X"}
8
Returns: 3
A distance of 8 can get us anywhere on the map, so we can reach all 3 bus stops.
2)

????
{"BBBBB",
 "BB.BB",
 "B.X.B",
 "BB.BB",
 "BBBBB"}
1
Returns: 0
Plenty of bus stops, but unfortunately we cannot reach any of them.
3)

????
{"B..B..",
 ".B...B",
 "..B...",
 "..B.X.",
 "B.B.B.",
 ".B.B.B"}
3
Returns: 7

This problem statement is the exclusive and proprietary property of TopCoder,
Inc. Any unauthorized use or reproduction of this information without the prior
written consent of TopCoder, Inc. is strictly prohibited. (c)2003, TopCoder,
Inc. All rights reserved.

google算法编程大赛.zip 立即下载

相关推荐

Google中国编程大赛入围赛真题

Google中国编程大赛入围赛真题

Google为改善其视频析算法举办大奖赛

现在谷歌为此计划带来重大更新,除了加入更多视频标签和音频元素外,他们更在 Kaggle 社交发起奖金总值达 100,000 美元的竞赛,吸引各路编程好手能设计最好的算法来为 700,000 套视频加入标签(用于训练的 8M 数据组数目)。胜出者名单将会在 7 月在 IEEE 会议上的 YouTube-8M Workshop 中公布,最佳队伍能获得 30,000 美元,所谓重赏之下、必有勇夫,相信能吸引不少身怀绝技的团队参赛。编辑:张宏宇,审核员:逄增宝。

bingyu1024的博客 150

算法编程大赛题目(.zip)

资源包含了谷歌算法大赛的几个算法编程问题(包括磁盘问题,公交车,画图,矩阵中查找单词路径,球和篮子,扔石头问题)的要求和解答,适合喜欢算法的人研究,锻炼编程思维,挑战自我!

Google编程挑战赛&“创新杯”全球学生科技大赛(大赛系列第13期)

Google编程挑战赛创办于2003年,成立目标是为 Google 选拔顶尖的工程人才。这项比赛对参赛者的年龄并没有特别严格的限制,只要年满13周岁即可。比赛的内容是在特定时间内使用任意编程语言和开发环境来解决特定的算法问题。被称为“中国大学生编程第一人“、现小马智行(Pony.ai)创始人楼天城曾于2008、2009年两次获得这项比赛的全球冠军。 (这是Google编程挑战赛的图片) 同样是在2003年,微软也首次举办了“创新杯”全球学生科技大赛,致力于将学生...

kzjj_xc的博客 1491

8个全球性编程比赛,天才程序员的梦想舞台

很多编程爱好者在学习之初,都渴望与全球的程序员一较高下,以证明自己的实力。一些全球性的编程竞赛为他们提供了这样的机会,不仅可以与全世界的顶尖程序员们交流,还有机会获得丰厚的奖金和进入顶级公司的机会,更重要的,在这样的舞台上可以尽情展示自己的才华,争夺荣誉,这可能是每个程序员的梦想。今天给大家享8个全球性的编程比赛,天才程序员们可以行动起来了。

Mr_HelloWorldx的博客 4669

有哪些高含金量的编程竞赛?

1.USACO(美国计算机奥林匹克竞赛) USACO(UnitedStatesofAmericaComputingOlympiad,美国计算机奥林匹克竞赛)是一项针对全世界所有的高中信息学竞赛选手的一项竞赛。开设目的是为每年夏季举办的国际信息学奥林匹克竞赛(IOI)选拔美国队队员。这项赛事不仅可以培养学生的算法和编程思维,好的竞赛成绩还能给孩子大学申请加。由于有些编程题跟谷歌,脸书等顶级科技公司面试题类似,好的USACO竞赛成绩对孩子以后申请实习也大有裨益。 官网网址:http://www.usa

yanjunhao2017的博客 9258

中移集成首届OneCity编程大赛Baseline

机缘巧合在DC竞赛上看到了这个比赛,这个编程比赛正是数据类算法比赛,主要是自然语言处理相关的文本多类任务,老肥我从来没有学习过这NLP领域相关的知识,正好借这个比赛学习充电,在此享一...

老肥码码码 534

关于搜索

google搜索原理论文 Google编程大赛入围赛750真题   第五组 Problem Statement牋牋You

Embeddable Life 1733

Google编程大赛入围赛750真题(第五组) 之解法

在CSDN首页看到Google编程大赛入围赛750真题   第五组之后,一时手痒,动手用C++做了一个解决方案,写出来接受大家的批评,呵呵。先贴上代码,=============================================================================#pragma warning (disable : 4786)#include #incl

RoadNorth的专栏 9973

Google中国编程挑战赛-题目解答

Problem Statement You are given a String[] grid representing a rectangular grid of letters. You are also given a String find, a word you are to find within the grid. The starting point may be anywhe

爱莎可实验室 3154

Google编程挑战赛一道250题的解法

最近正好学C++,所以尝试用C++来解这道题,过多地加入了很多不必要的语句(为了练习语法),不过效率和结果应该都能达到要求,大家随便看看了.基本思想: 因为箱子是不同的,球是相同的,所以对箱子编号. 第一次把球放到1号箱子的情况下,其后可放入所有箱子. 第一次把球放到2号箱子的情况下,其后除了1箱子不能使用外,都可放入其他箱子(避免重复).以此类推Question:Problem Statemen

1988

Google编程大赛解题一道

Google编程大赛的题目的确对算法、思维能力是一个考验,在一个小时内完成的确是有点难度。经过检验,才发现自己在这方面平时的确比较欠缺呀。这道题我可是做了近半天才作完整了,跑通了题目给出的所有case。原题:Problem StatementYou are given a String[] grid representing a rectangular grid of letters. You a

zmxj的专栏 5044

google中国编程挑战赛题目

1.Problem Statement    You are playing a card game, and in your hand, you are holding several cards. Each card has a suit, S, H, D, or C, and a value between 1 and 10, inclusive. You may play

BigMonster's Blog 1749

google编程大赛模拟题及入围赛真题

http://www.blogjava.net/emu/category/2769.html http://blog.csdn.net/RoadNorth/article/details/554027

侯文博的专栏 1619

Google编程大赛入围赛750真题

Google编程大赛入围赛750真题   第五组Problem Statement牋牋You are given a String[] grid representing a rectangular grid of letters. You are also given a String find, a word you are to find within the grid. The star

陈亚平 的技术博客 7066
上一篇: Google编程大赛入围赛750分真题
下一篇: google 被黑了?!
陈亚平
博客等级 码龄23年 47粉丝 85原创
评论 3
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

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

抵扣说明:

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

余额充值