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

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

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

    Thinking in XiaoQiang
    世人皆有悲哀,只有你不明白
    posts - 56,comments - 150,trackbacks - 0

    終于等到google編程賽開始了,可是居然不能登錄到arena.急啊!!
    晚上好不容易open了一道250分的題,還沒看完題呢就掉線了,等我再上去時,時間只剩下不到10分鐘了.
    可惜啊可惜啊~~~~

    好在我也自知水平有限,目標只是為了摻和
    ------------------------------------------------------------------------------------------------------


    250的:
    Problem Statement
       
    You are given a String input. You are to find the longest substring of input such that the reversal of the substring is also a substring of input. In case of a tie, return the string that occurs earliest in input.
    Definition
       
    Class:
    ReverseSubstring
    Method:
    findReversed
    Parameters:
    String
    Returns:
    String
    Method signature:
    String findReversed(String input)
    (be sure your method is public)
       
    Notes
    -
    The substring and its reversal may overlap partially or completely.
    -
    The entire original string is itself a valid substring (see example 4).
    Constraints
    -
    input will contain between 1 and 50 characters, inclusive.
    -
    Each character of input will be an uppercase letter ('A'-'Z').
    Examples
    0)
       
    "XBCDEFYWFEDCBZ"
    Returns: "BCDEF"
    We see that the reverse of BCDEF is FEDCB, which appears later in the string.
    1)
       
    "XYZ"
    Returns: "X"
    The best we can do is find a one character substring, so we implement the tie-breaker rule of taking the earliest one first.
    2)
       
    "ABCABA"
    Returns: "ABA"
    The string ABA is a palindrome (it's its own reversal), so it meets the criteria.
    3)
       
    "FDASJKUREKJFDFASIREYUFDHSAJYIREWQ"
    Returns: "FDF"
    4)
       
    "ABCDCBA"
    Returns: "ABCDCBA"
    Here, the entire string is its own reversal.

     


    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 starting point may be anywhere in the grid. The path may move up, down, left, right, or diagonally from one letter to the next, and may use letters in the grid more than once, but you may not stay on the same cell twice in a row (see example 6 for clarification).
    You are to return an int indicating the number of ways find can be found within the grid. If the result is more than 1,000,000,000, return -1.
    Definition
       
    Class:
    WordPath
    Method:
    countPaths
    Parameters:
    String[], String
    Returns:
    int
    Method signature:
    int countPaths(String[] grid, String find)
    (be sure your method is public)
       
    Constraints
    -
    grid will contain between 1 and 50 elements, inclusive.
    -
    Each element of grid will contain between 1 and 50 uppercase ('A'-'Z') letters, inclusive.
    -
    Each element of grid will contain the same number of characters.
    -
    find will contain between 1 and 50 uppercase ('A'-'Z') letters, inclusive.
    Examples
    0)
       
    {"ABC",
     "FED",
     "GHI"}
    "ABCDEFGHI"
    Returns: 1
    There is only one way to trace this path. Each letter is used exactly once.
    1)
       
    {"ABC",
     "FED",
     "GAI"}
    "ABCDEA"
    Returns: 2
    Once we get to the 'E', we can choose one of two directions for the final 'A'.
    2)
       
    {"ABC",
     "DEF",
     "GHI"}
    "ABCD"
    Returns: 0
    We can trace a path for "ABC", but there's no way to complete a path to the letter 'D'.
    3)
       
    {"AA",
     "AA"}
    "AAAA"
    Returns: 108
    We can start from any of the four locations. From each location, we can then move in any of the three possible directions for our second letter, and again for the third and fourth letter. 4 * 3 * 3 * 3 = 108.
    4)
       
    {"ABABA",
     "BABAB",
     "ABABA",
     "BABAB",
     "ABABA"}
    "ABABABBA"
    Returns: 56448
    There are a lot of ways to trace this path.
    5)
       
    {"AAAAA",
     "AAAAA",
     "AAAAA",
     "AAAAA",
     "AAAAA"}
    "AAAAAAAAAAA"
    Returns: -1
    There are well over 1,000,000,000 paths that can be traced.
    6)
       
    {"AB",
     "CD"}
    "AA"
    Returns: 0
    Since we can't stay on the same cell, we can't trace the path at all.


    在夢想中期待,在掉線中慘敗
    posted on 2005-12-13 09:48 小強 閱讀(429) 評論(0)  編輯  收藏 所屬分類: 技術相關
    主站蜘蛛池模板: eeuss影院ss奇兵免费com| 曰韩亚洲av人人夜夜澡人人爽| 亚洲av纯肉无码精品动漫| 18禁美女黄网站色大片免费观看| 亚洲国产日韩在线人成下载| 国产免费怕怕免费视频观看| 日本免费久久久久久久网站| 亚洲精品国产高清在线观看| 国产精品亚洲а∨无码播放| 成人午夜视频免费| 最近中文字幕大全免费版在线| 狠狠色伊人亚洲综合成人| 日韩精品成人无码专区免费 | 2017亚洲男人天堂一| 亚洲国产精品毛片av不卡在线| 色屁屁www影院免费观看视频| 又粗又黄又猛又爽大片免费| 久久久国产精品无码免费专区| 国产成人亚洲精品蜜芽影院| 亚洲AV永久无码精品一区二区国产 | 国产卡一卡二卡三免费入口 | 国产精品免费久久| 亚洲AV成人无码天堂| 亚洲人成网站在线播放vr| 无码精品国产一区二区三区免费 | 久久精品国产亚洲夜色AV网站| 国产一卡二卡≡卡四卡免费乱码| **毛片免费观看久久精品| 一级毛片免费在线观看网站| 亚洲日韩精品无码AV海量| 亚洲A丁香五香天堂网| 青草草色A免费观看在线| 国产亚洲精品美女久久久久久下载| 亚洲一区免费观看| 国产亚洲一区二区三区在线不卡| 99在线视频免费| 岛国精品一区免费视频在线观看 | 亚洲成综合人影院在院播放| 亚洲一区爱区精品无码| 免费二级毛片免费完整视频| 日韩视频在线免费观看|