<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 閱讀(1203) 評論(0)  編輯  收藏 所屬分類: Java
    主站蜘蛛池模板: 成年大片免费高清在线看黄| 亚洲综合av一区二区三区不卡| 人人爽人人爽人人片A免费 | 成人特黄a级毛片免费视频| 亚洲成色999久久网站| 黄色视屏在线免费播放| 国产亚洲视频在线播放| 在线看片免费人成视频久网下载 | 99re6在线视频精品免费| 亚洲一区二区三区无码影院| 精品国产污污免费网站入口| 亚洲色成人中文字幕网站| 国产综合免费精品久久久| 亚洲精品无码久久一线| 久久久免费的精品| 亚洲精品美女在线观看播放| 国产福利在线观看免费第一福利| 国产精品亚洲四区在线观看 | 亚洲精品麻豆av| 两个人www免费高清视频| 亚洲成AV人片在线观看| 精品国产污污免费网站aⅴ| 亚洲精品国产国语| 免费一级做a爰片久久毛片潮喷| 一个人看的www在线免费视频| 亚洲VA成无码人在线观看天堂 | 精品成人免费自拍视频| 亚洲精品第五页中文字幕| 在线jlzzjlzz免费播放| 曰韩无码AV片免费播放不卡| 亚洲av无码成人黄网站在线观看| 91免费精品国自产拍在线不卡| 亚洲欧美日韩国产成人| 亚洲人午夜射精精品日韩| 日韩人妻无码精品久久免费一| 亚洲色少妇熟女11p| ZZIJZZIJ亚洲日本少妇JIZJIZ| 久久A级毛片免费观看| 久久精品国产亚洲AV未满十八 | 亚洲午夜精品一级在线播放放 | 性色午夜视频免费男人的天堂|