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

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>
            欧美日韩三级一区二区| 久久99在线观看| 国产精品草草| 欧美乱大交xxxxx| 欧美—级在线免费片| 欧美国产亚洲精品久久久8v| 在线免费不卡视频| 欧美日韩在线视频一区| 欧美精品免费看| 欧美精品导航| 欧美视频一区二区| 国产精品一区在线观看| 国内视频一区| 亚洲黄色一区| 亚洲午夜精品在线| 久久国产手机看片| 欧美激情一区二区三级高清视频 | 欧美成年人网| 欧美伦理91i| 国产精品极品美女粉嫩高清在线| 欧美一区二区三区视频在线观看| 亚洲视频国产视频| 久久精品青青大伊人av| 欧美激情免费在线| 国产亚洲欧美一区二区| 91久久久久| 性18欧美另类| 亚洲国产精品久久久久秋霞影院| 欧美成人免费播放| 一区二区三区四区五区精品| 午夜精品亚洲一区二区三区嫩草| 美女黄网久久| 国产九区一区在线| 亚洲肉体裸体xxxx137| 欧美亚洲视频在线观看| 欧美搞黄网站| 久久成人人人人精品欧| 欧美另类人妖| 亚洲国产精品传媒在线观看| 亚洲直播在线一区| 亚洲电影激情视频网站| 欧美一级一区| 国产精品久久久一本精品| 亚洲国产欧美日韩另类综合| 欧美亚洲一区| 制服丝袜亚洲播放| 欧美精品成人在线| 亚洲国产精品va在看黑人| 久久久久久久网| 午夜精品福利电影| 国产精品久99| 亚洲婷婷综合久久一本伊一区| 美日韩丰满少妇在线观看| 亚洲欧美www| 国产精品日韩久久久| 亚洲视频网在线直播| 亚洲欧洲三级电影| 欧美成人性生活| 亚洲人午夜精品免费| 欧美aa在线视频| 久久久成人网| 亚洲视频在线观看| 日韩一级欧洲| 欧美xx69| 91久久精品www人人做人人爽 | 老妇喷水一区二区三区| 国产亚洲综合在线| 欧美一区二区三区在线观看| 亚洲性夜色噜噜噜7777| 国产精品毛片在线| 欧美在线一级视频| 欧美一区二区三区免费视| 国产深夜精品福利| 久久蜜桃香蕉精品一区二区三区| 午夜久久99| 国内外成人免费激情在线视频网站| 欧美专区亚洲专区| 久久一综合视频| 亚洲精品小视频在线观看| 亚洲三级影片| 欧美日韩精品免费观看| 亚洲一区视频在线| 欧美亚洲视频在线观看| 精品成人在线| 亚洲福利小视频| 欧美午夜精品一区| 久久精视频免费在线久久完整在线看 | 国产精品男gay被猛男狂揉视频| 亚洲一区在线免费观看| 亚洲欧美日韩国产中文| 伊人影院久久| 亚洲黄色大片| 国产精品进线69影院| 久久中文字幕一区| 欧美精品一区二区三区蜜臀| 亚洲影院高清在线| 久久久国产精品一区二区中文 | 午夜精品区一区二区三| 久久国产精品久久国产精品 | 欧美日韩在线直播| 久久久精品一区二区三区| 老司机亚洲精品| 亚洲综合成人婷婷小说| 久久不见久久见免费视频1| 亚洲精品视频在线观看网站| 亚洲男女毛片无遮挡| 亚洲国产乱码最新视频| 亚洲一区二区在线| 亚洲精品激情| 欧美影院在线| 亚洲在线免费观看| 欧美成人免费va影院高清| 欧美一级在线视频| 欧美freesex交免费视频| 午夜精品视频网站| 欧美二区在线观看| 美女精品在线| 国产精品综合不卡av| 亚洲二区在线观看| 国产一区免费视频| 亚洲一区激情| 夜夜嗨av一区二区三区免费区| 久久国产精品一区二区三区| 亚洲女性裸体视频| 欧美精品在线视频| 亚洲国产成人在线播放| 激情亚洲网站| 欧美在线免费观看| 欧美自拍丝袜亚洲| 国产酒店精品激情| 中文在线一区| 亚洲一级黄色片| 欧美日韩另类视频| 亚洲欧洲另类| 一区二区三区高清视频在线观看 | 欧美日韩一区在线观看| 亚洲电影免费观看高清完整版在线观看 | 久久日韩精品| 国产精品一香蕉国产线看观看| 日韩视频中文| 在线视频欧美日韩| 欧美另类变人与禽xxxxx| 91久久嫩草影院一区二区| 亚洲国产导航| 老司机一区二区三区| 男女精品视频| 亚洲精品日韩激情在线电影| 欧美成人情趣视频| 亚洲国产美女| 一区二区三区国产在线| 欧美体内she精视频| 亚洲一品av免费观看| 欧美一区日韩一区| 国语自产在线不卡| 美女视频黄a大片欧美| 亚洲国产一区二区三区高清| 亚洲精品在线观看视频| 欧美日韩视频一区二区| 亚洲免费在线视频| 久久综合九色99| 亚洲精品一区二区三区不| 欧美精品v国产精品v日韩精品| 日韩视频在线一区二区| 久久av资源网站| 亚洲国产综合在线| 欧美天天影院| 久久久999国产| 91久久精品国产| 欧美在线免费播放| 亚洲日本欧美在线| 国产精品区一区二区三区| 久久久久久亚洲精品中文字幕 | 欧美激情2020午夜免费观看| 艳妇臀荡乳欲伦亚洲一区| 久久激情五月丁香伊人| 亚洲福利av| 亚洲日韩成人| 91久久精品国产91久久| 欧美午夜免费影院| 久久成人一区| 亚洲精品一区二区在线观看| 久久动漫亚洲| 夜夜嗨av一区二区三区网站四季av| 国产精品久久久久久久午夜| 久久噜噜噜精品国产亚洲综合| 亚洲日本电影| 久久久久一区二区三区四区| 一本久道久久综合婷婷鲸鱼| 好吊视频一区二区三区四区| 欧美午夜不卡| 免费观看一级特黄欧美大片| 亚洲一区二区三区777| 欧美高清成人| 欧美一区二区网站| 一本大道久久a久久精二百| 国内精品美女av在线播放| 欧美日韩在线一区二区| 欧美成人中文字幕| 久久久精品国产一区二区三区| 一区二区三区欧美成人|