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

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

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

    Java Votary

      BlogJava :: 首頁 :: 新隨筆 :: 聯系 :: 聚合  :: 管理 ::
      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蜜桃在线观看免费视频网站| 亚洲一区二区女搞男| 韩国免费a级作爱片无码| 久久久久无码专区亚洲av| 一个人看的免费高清视频日本| 黄页免费在线观看| 亚洲av永久无码制服河南实里| 在线毛片片免费观看| 国产免费午夜a无码v视频| 菠萝菠萝蜜在线免费视频| 亚洲精品专区在线观看| v片免费在线观看| 国产AV无码专区亚洲AVJULIA | 国产精品亚洲午夜一区二区三区| 国产成人免费在线| 亚洲欧美日韩中文无线码| 在线a亚洲v天堂网2018| 亚洲中文字幕在线无码一区二区| 91在线品视觉盛宴免费| 自拍偷自拍亚洲精品播放| 2021免费日韩视频网| 国产精品亚洲小说专区| 亚洲午夜久久久久久久久久| 无码少妇精品一区二区免费动态| 亚洲色偷偷狠狠综合网| 免费av片在线观看网站| 亚洲国产日韩精品| 亚洲精品无码你懂的网站| 18禁黄网站禁片免费观看不卡| 亚洲AV午夜成人片| 三年片在线观看免费观看高清电影 | 国产免费av片在线看| 妇女自拍偷自拍亚洲精品| 亚洲AV午夜成人影院老师机影院| 国产在线jyzzjyzz免费麻豆| 国产91成人精品亚洲精品| 亚洲av鲁丝一区二区三区| 女人18毛片a级毛片免费 |