<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
    主站蜘蛛池模板: 国产成人综合亚洲AV第一页 | 久久午夜夜伦鲁鲁片免费无码| 国产色在线|亚洲| 成人爽A毛片免费看| a级精品九九九大片免费看| 亚洲AV日韩AV无码污污网站| 久久久久亚洲AV无码观看| 国产亚洲精品无码专区| 亚洲午夜免费视频| 亚洲精品视频免费| 成年大片免费高清在线看黄| 亚洲色成人WWW永久在线观看| 伊在人亚洲香蕉精品区麻豆| 在线a级毛片免费视频| 妇女自拍偷自拍亚洲精品| 亚洲人成伊人成综合网久久久| 免费一级毛片清高播放| 久久免费视频网站| 亚洲人成色99999在线观看| 久久亚洲精品无码aⅴ大香 | 日批视频网址免费观看| 一级特黄a免费大片| 日木av无码专区亚洲av毛片| 亚洲精品成人网站在线观看| 韩国免费一级成人毛片| 色老头综合免费视频| 国产成人精品亚洲| 666精品国产精品亚洲 | 无码国产精品一区二区免费式芒果| 国产免费一区二区三区免费视频| 亚洲网站在线播放| 亚洲国产成人影院播放| 亚洲国产精品无码久久九九| 波多野结衣免费视频观看 | WWW国产亚洲精品久久麻豆| 亚洲sm另类一区二区三区| 亚洲不卡中文字幕无码| 亚洲AV无码一区二区三区系列| 国产亚洲日韩一区二区三区| 国产亚洲精品a在线观看| 国产亚洲精品无码成人|