青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品

posts - 74,  comments - 33,  trackbacks - 0
The Troublesome Frog
Time Limit: 5000MS Memory Limit: 100000K
Total Submissions: 3595 Accepted: 1058
Case Time Limit: 500MS

Description

In Korea, the naughtiness of the cheonggaeguri, a small frog, is legendary. This is a well-deserved reputation, because the frogs jump through your rice paddy at night, flattening rice plants. In the morning, after noting which plants have been flattened, you want to identify the path of the frog which did the most damage. A frog always jumps through the paddy in a straight line, with every hop the same length:

Your rice paddy has plants arranged on the intersection points of a grid as shown in Figure-1, and the troublesome frogs hop completely through your paddy, starting outside the paddy on one side and ending outside the paddy on the other side as shown in Figure-2:

Many frogs can jump through the paddy, hopping from rice plant to rice plant. Every hop lands on a plant and flattens it, as in Figure-3. Note that some plants may be landed on by more than one frog during the night. Of course, you can not see the lines showing the paths of the frogs or any of their hops outside of your paddy ?for the situation in Figure-3, what you can see is shown in Figure-4:

From Figure-4, you can reconstruct all the possible paths which the frogs may have followed across your paddy. You are only interested in frogs which have landed on at least 3 of your rice plants in their voyage through the paddy. Such a path is said to be a frog path. In this case, that means that the three paths shown in Figure-3 are frog paths (there are also other possible frog paths). The vertical path down column 1 might have been a frog path with hop length 4 except there are only 2 plants flattened so we are not interested; and the diagonal path including the plants on row 2 col. 3, row 3 col. 4, and row 6 col. 7 has three flat plants but there is no regular hop length which could have spaced the hops in this way while still landing on at least 3 plants, and hence it is not a frog path. Note also that along the line a frog path follows there may be additional flattened plants which do not need to be landed on by that path (see the plant at (2, 6) on the horizontal path across row 2 in Figure-4), and in fact some flattened plants may not be explained by any frog path at all.

Your task is to write a program to determine the maximum number of landings in any single frog path (where the maximum is taken over all possible frog paths). In Figure-4 the answer is 7, obtained from the frog path across row 6.

Input

Your program is to read from standard input. The first line contains two integers R and C, respectively the number of rows and columns in your rice paddy, 1 <= R,C <= 5000. The second line contains the single integer N, the number of flattened rice plants, 3 <= N <= 5000. Each of the remaining N lines contains two integers, the row number (1 <= row number <= R) and the column number (1 <= column number <= C) of a flattened rice plant, separated by one blank. Each flattened plant is only listed once.

Output

Your program is to write to standard output. The output contains one line with a single integer, the number of plants flattened along a frog path which did the most damage if there exists at least one frog path, otherwise, 0.

Sample Input

6 7
14
2 1
6 6
4 2
2 5
2 6
2 7
3 4
6 1
6 2
2 3
6 3
6 4
6 5
6 7

Sample Output

7
我第一次對(duì)自己的英持有懷疑態(tài)度。。。。一個(gè)半小時(shí)讀題,可能是在宿舍凈聽(tīng)魔獸的聲音了。。。。。。
靠,暈!
maybe something wrong with me,
I got ac with a time of 3.3s,but Others got ac with 700ms and 300k memory.
Faint.....
代碼巨丑,第一次用這么長(zhǎng)時(shí)間,排了倒數(shù)幾名
posted on 2009-01-08 20:44 KNIGHT 閱讀(299) 評(píng)論(1)  編輯 收藏 引用

FeedBack:
# re: The Troublesome Frog
2009-01-08 22:32 | Knight
我暈,一個(gè)晚上居然沒(méi)調(diào)出來(lái)。。。。。
讀題還少了條件。。。。。
現(xiàn)在可好了還是超時(shí)的東西。。。。  回復(fù)  更多評(píng)論
  

只有注冊(cè)用戶登錄后才能發(fā)表評(píng)論。
網(wǎng)站導(dǎo)航: 博客園   IT新聞   BlogJava   博問(wèn)   Chat2DB   管理


<2009年1月>
28293031123
45678910
11121314151617
18192021222324
25262728293031
1234567

常用鏈接

留言簿(8)

隨筆檔案

文章檔案

Friends

OJ

搜索

  •  

最新評(píng)論

閱讀排行榜

評(píng)論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <ins id="pjuwb"></ins>
    <blockquote id="pjuwb"><pre id="pjuwb"></pre></blockquote>
    <noscript id="pjuwb"></noscript>
          <sup id="pjuwb"><pre id="pjuwb"></pre></sup>
            <dd id="pjuwb"></dd>
            <abbr id="pjuwb"></abbr>
            免费欧美电影| 欧美日韩aaaaa| 欧美国产视频在线观看| 欧美在线观看网址综合| 久久爱www久久做| 亚洲欧美一区二区三区极速播放| 日韩一级不卡| 亚洲天堂免费在线观看视频| 国产精品欧美一区二区三区奶水 | 99riav国产精品| 欧美sm极限捆绑bd| 久久综合色播五月| 欧美在线高清| 久久精品日韩欧美| 久久精品一区四区| 久久久久久电影| 麻豆精品网站| 欧美成人中文字幕| 亚洲精品123区| 欧美福利网址| 亚洲精品免费在线播放| 亚洲精品乱码久久久久久黑人| 亚洲欧洲一级| 在线亚洲欧美视频| 欧美一级黄色录像| 久久精品国产第一区二区三区最新章节| 性欧美video另类hd性玩具| 欧美一区二区视频在线| 欧美一区二区三区免费大片| 中文国产成人精品| 欧美在线播放一区二区| 欧美国产综合一区二区| 国产精品v欧美精品v日韩| 国产精品日韩精品欧美在线| 黄色资源网久久资源365| 伊人久久亚洲美女图片| 亚洲国产另类久久久精品极度| 欧美性开放视频| 国产亚洲a∨片在线观看| 欧美色区777第一页| 国产精品视频免费观看www| 一区二区在线观看视频在线观看| 日韩午夜在线| 久久精品一区中文字幕| 亚洲国产精品久久精品怡红院| 夜夜爽www精品| 欧美一进一出视频| 欧美伦理一区二区| 国产一区二区三区成人欧美日韩在线观看| 亚洲福利精品| 欧美一级淫片播放口| 欧美暴力喷水在线| 亚洲天堂av图片| 欧美a级理论片| 国产亚洲a∨片在线观看| 国产精品99久久99久久久二8| 老司机aⅴ在线精品导航| 亚洲日本欧美日韩高观看| 香港久久久电影| 欧美日韩视频在线一区二区 | 狠狠色丁香久久婷婷综合丁香| 亚洲剧情一区二区| 快射av在线播放一区| 亚洲一区日本| 欧美涩涩网站| 日韩小视频在线观看专区| 麻豆av一区二区三区久久| 亚洲欧美国产精品va在线观看 | 国产精品盗摄一区二区三区| 亚洲国产三级网| 久久亚洲二区| 欧美在线啊v| 国产精品久久久999| 夜夜爽av福利精品导航 | 亚洲伦理中文字幕| 欧美成人免费全部| 在线观看一区视频| 久久免费国产精品1| 午夜老司机精品| 国产精品揄拍500视频| 亚洲在线视频| 亚洲性夜色噜噜噜7777| 美女黄网久久| 91久久久亚洲精品| 欧美国产日韩亚洲一区| 免费av成人在线| 免费久久99精品国产自| 久久激情视频久久| 狠狠干综合网| 欧美大胆成人| 久久国产精品久久久久久电车| 国模 一区 二区 三区| 久久久久国色av免费观看性色| 亚洲欧美日韩网| 国产伦精品一区二区三区视频孕妇 | 久久精品免视看| 国产一区二区中文| 久久视频国产精品免费视频在线| 亚洲欧美日韩精品一区二区 | 亚洲一区二区三区欧美| 国产欧美一区二区视频| 欧美.com| 亚洲欧美中文字幕| 激情六月婷婷久久| 欧美黄色一级视频| 欧美久久婷婷综合色| 亚洲一区免费在线观看| 亚洲欧美在线另类| 在线播放精品| 91久久精品美女高潮| 欧美午夜在线观看| 久久免费高清| 欧美激情一二三区| 午夜精品久久久久久久99热浪潮| 亚洲一区二区三区涩| 国语自产精品视频在线看抢先版结局 | 性久久久久久久| 校园春色国产精品| 亚洲人成免费| 亚洲综合视频1区| 亚洲风情亚aⅴ在线发布| 99在线精品视频在线观看| 国产一区二区高清不卡| 亚洲国产综合在线看不卡| 国产乱码精品一区二区三区av| 美女视频一区免费观看| 欧美日韩中文精品| 久久一本综合频道| 国产精品多人| 欧美激情在线有限公司| 国产嫩草一区二区三区在线观看| 欧美激情亚洲精品| 国产欧美日韩在线| 亚洲免费成人av| 在线看无码的免费网站| 性8sex亚洲区入口| 久久aⅴ国产欧美74aaa| 男女视频一区二区| 欧美在线亚洲综合一区| 欧美人与性动交cc0o| 久久久久综合一区二区三区| 欧美精品一区在线播放| 久久久99爱| 欧美性猛交xxxx乱大交退制版| 美日韩免费视频| 国产在线精品二区| 国产精品99久久久久久久vr | 久久久99久久精品女同性| 欧美午夜大胆人体| 亚洲精品视频在线观看网站 | 亚洲免费成人| 久久久亚洲人| 久久综合导航| 国产一区二区三区免费观看 | 欧美手机在线| 亚洲人成网站999久久久综合| 亚洲国产精品成人综合| 久久精品国产v日韩v亚洲 | 香蕉久久夜色精品国产| 午夜国产精品视频| 欧美日本在线| 欧美在线不卡| 欧美日韩国产三区| 日韩视频永久免费观看| 亚洲乱码久久| 欧美成人久久| 男人的天堂成人在线| 国产一区二区0| 欧美亚洲一区三区| 久久久久成人网| 激情综合色丁香一区二区| 久久另类ts人妖一区二区| 女同性一区二区三区人了人一| 亚洲国产日韩在线| 欧美日韩免费观看中文| 亚洲午夜久久久| 午夜视频在线观看一区二区| 欧美激情第二页| 亚洲一区二区四区| 国产午夜亚洲精品理论片色戒| 欧美一区三区二区在线观看| 久久色中文字幕| 亚洲国产美女久久久久| 欧美日韩免费观看一区三区| 亚洲一区二区三区精品在线| 久久精品九九| 欧美淫片网站| 亚洲第一精品在线| 国产精品视频免费一区| 欧美成人免费播放| 久久精品人人做人人综合| 一区二区三区高清| 亚洲大胆在线| 久久视频这里只有精品| 亚洲国产一区二区视频| 国产伦精品免费视频| 欧美成人三级在线| 欧美在线不卡| 亚洲无吗在线| 亚洲欧洲精品一区二区三区|