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

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>
            欧美精品一区在线播放| 亚洲免费视频中文字幕| 免费观看不卡av| 鲁大师成人一区二区三区| 欧美一区二区三区免费大片| 亚洲一区二区视频在线观看| 亚洲一区免费看| 欧美在线一二三区| 免费成人av在线| 欧美日韩妖精视频| 国产精品久久久久久久app| 国产私拍一区| 亚洲国产精品福利| 一区二区毛片| 久久久国产一区二区三区| 欧美高清视频免费观看| 亚洲精华国产欧美| 亚洲乱码国产乱码精品精| 亚洲一区二区久久| 男女精品视频| 国产精品亚洲综合一区在线观看| 国内成人精品一区| 亚洲网站视频| 美国十次成人| 一二三区精品福利视频| 久久久久久久综合日本| 欧美亚洲成人网| 亚洲国产欧美久久| 午夜精品影院| 亚洲第一视频网站| 亚洲欧美日韩在线观看a三区| 可以看av的网站久久看| 欧美网站在线| 亚洲人体影院| 久久青草久久| 亚洲一区二区三区中文字幕在线| 欧美91大片| 狠狠色噜噜狠狠狠狠色吗综合| 亚洲天堂成人在线观看| 欧美成人中文| 亚洲欧美日韩另类| 欧美视频一区在线观看| 久久久水蜜桃| 国产欧美在线观看| 亚洲春色另类小说| 亚洲综合色噜噜狠狠| 欧美激情精品久久久久久| 亚洲免费一在线| 欧美日韩精品三区| 最近看过的日韩成人| 开心色5月久久精品| 午夜欧美理论片| 国产精品国色综合久久| 亚洲另类春色国产| 欧美福利视频在线观看| 午夜精品在线| 国产欧美日韩精品a在线观看| 在线亚洲一区观看| 亚洲国产清纯| 欧美成va人片在线观看| 亚洲第一网站免费视频| 米奇777超碰欧美日韩亚洲| 亚洲欧美日韩国产一区| 欧美性色aⅴ视频一区日韩精品| 日韩视频在线观看| 99re热这里只有精品视频| 欧美精品粉嫩高潮一区二区| 亚洲激情综合| 亚洲国产1区| 欧美激情视频一区二区三区免费| 亚洲日本电影在线| 亚洲国产精品123| 欧美二区在线看| 一个色综合av| 亚洲视频观看| 国产一区二区三区在线播放免费观看| 欧美一区二区三区四区视频| 小嫩嫩精品导航| 亚洲黄色片网站| 99国产精品久久久久久久| 欧美日韩午夜| 欧美在线一二三四区| 久久国产精品99精品国产| 狠色狠色综合久久| 亚洲第一在线| 欧美午夜视频| 久久久水蜜桃| 女同一区二区| 欧美一级片一区| 久热综合在线亚洲精品| 9l视频自拍蝌蚪9l视频成人| 亚洲深爱激情| 永久免费毛片在线播放不卡| 欧美高清在线播放| 欧美午夜精品久久久久久孕妇| 久久成人羞羞网站| 免费亚洲婷婷| 午夜亚洲性色视频| 久久亚洲风情| 亚洲女同同性videoxma| 久久精品国产精品亚洲综合| 99国内精品久久| 亚洲欧美日韩国产中文在线| 亚洲精品一区二区三区四区高清| 欧美老女人xx| 国产原创一区二区| 亚洲国产成人高清精品| 欧美日韩亚洲一区二区三区四区 | 黄色国产精品| 日韩西西人体444www| 国产一区二区激情| 亚洲三级性片| 伊人成综合网伊人222| 亚洲精品视频中文字幕| 国内精品福利| 在线综合亚洲| 亚洲精品免费观看| 久久久国产精品一区| 亚洲综合日韩| 欧美精品 国产精品| 美女被久久久| 国产视频久久网| 亚洲小说区图片区| 亚洲丝袜av一区| 欧美精品1区2区3区| 欧美岛国在线观看| 国产视频在线观看一区| 亚洲夜间福利| 亚洲欧美日韩精品一区二区 | 日韩午夜黄色| 一级成人国产| 欧美日本在线播放| 亚洲国产中文字幕在线观看| 亚洲国产激情| 欧美成人免费网| 亚洲福利小视频| 亚洲精品在线观看免费| 欧美国产激情二区三区| 欧美激情一区二区三级高清视频| 国产一区二区成人| 欧美一区二区性| 久久久久久尹人网香蕉| 国产一区二区中文| 久久国产欧美精品| 久久尤物视频| 亚洲国产精品va在线看黑人| 麻豆久久婷婷| 亚洲国产精品久久久久秋霞影院| 亚洲国产精品第一区二区| 久久综合狠狠综合久久综合88| 美女网站久久| 一本一本大道香蕉久在线精品| 欧美精品久久久久久久久久| 91久久午夜| 亚洲影视在线播放| 国产精品视频精品| 久久国产精品毛片| 欧美多人爱爱视频网站| 一区二区三区国产在线| 国产精品午夜在线观看| 欧美自拍偷拍午夜视频| 牛牛影视久久网| 中文亚洲视频在线| 国产欧美亚洲视频| 久久中文久久字幕| 日韩视频久久| 99热在这里有精品免费| 久久激情视频久久| 国产精品一区二区你懂的| 欧美一区二区视频免费观看| 欧美大片在线观看一区| 中文成人激情娱乐网| 国产三级欧美三级| 老司机午夜精品| 亚洲视频免费看| 你懂的国产精品| 亚洲欧美精品在线观看| 狠狠色丁香婷综合久久| 欧美精品导航| 久久久欧美一区二区| 一本色道久久综合狠狠躁篇的优点| 久久久久国产免费免费| 99视频精品全部免费在线| 国产一区二区精品在线观看| 欧美伦理影院| 久久久久久亚洲精品杨幂换脸| 亚洲毛片一区| 女仆av观看一区| 欧美一区二区三区男人的天堂| 亚洲裸体俱乐部裸体舞表演av| 国产人妖伪娘一区91| 欧美日韩国产成人高清视频| 久久精品国产亚洲精品| 亚洲一区二区免费看| 日韩天天综合| 亚洲黄色三级| 欧美粗暴jizz性欧美20| 久久综合九色九九| 欧美在线91| 亚洲欧美日韩综合一区|