<rt id="bn8ez"></rt>
<label id="bn8ez"></label>

  • <span id="bn8ez"></span>

    <label id="bn8ez"><meter id="bn8ez"></meter></label>

    Java Votary

      BlogJava :: 首頁 :: 新隨筆 :: 聯(lián)系 :: 聚合  :: 管理 ::
      48 隨筆 :: 1 文章 :: 80 評論 :: 0 Trackbacks
    Google編程大賽入圍賽250分真題


    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.

    posted on 2005-12-15 13:14 Dion 閱讀(1192) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 最近免费中文字幕视频高清在线看| 99国产精品免费视频观看| 毛片免费观看视频| 亚洲国产最大av| 性色av无码免费一区二区三区| 亚洲性69影院在线观看| 亚洲电影在线免费观看| 亚洲宅男天堂a在线| 国产高清免费视频| 亚洲中文无码线在线观看| 曰批全过程免费视频播放网站 | 1000部免费啪啪十八未年禁止观看| 久久精品国产亚洲av成人| 嫩草成人永久免费观看| 亚洲伦理一区二区| 97av免费视频| 国产精品亚洲四区在线观看| 在线免费观看视频你懂的| 日韩色视频一区二区三区亚洲| 亚洲午夜国产片在线观看| 两个人看www免费视频| 亚洲AV无码成人网站久久精品大| 91精品国产免费网站| 亚洲精品午夜国产va久久| 免费无遮挡无码永久在线观看视频| 美女扒开尿口给男人爽免费视频 | 亚洲综合无码精品一区二区三区| 拍拍拍无挡视频免费观看1000 | 亚洲中文字幕无码mv| 国产又大又黑又粗免费视频| 人妻18毛片a级毛片免费看| 亚洲人成在线播放网站岛国| 久久不见久久见中文字幕免费| 18禁亚洲深夜福利人口| 亚洲一区爱区精品无码| 久久久久久久久久国产精品免费| 456亚洲人成影院在线观| 精品国产香蕉伊思人在线在线亚洲一区二区 | 亚洲成年人免费网站| 亚洲欧洲中文日产| 国产免费一区二区三区VR|