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

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>
            新67194成人永久网站| 欧美日韩综合另类| 亚洲高清不卡| 久久久久青草大香线综合精品| 午夜精品久久久久久久蜜桃app| 亚洲无线观看| 午夜精品久久久久99热蜜桃导演| 亚洲午夜电影在线观看| 性欧美video另类hd性玩具| 久久精品最新地址| 欧美电影电视剧在线观看| 亚洲肉体裸体xxxx137| 亚洲视频1区2区| 久久精品国产久精国产思思| 久久婷婷久久| 欧美三区在线视频| 国产欧美日韩精品a在线观看| 精品999日本| 亚洲一区二区三区精品动漫| 欧美资源在线观看| 欧美二区在线播放| 亚洲一区黄色| 裸体一区二区三区| 国产乱码精品1区2区3区| 亚洲高清在线精品| 欧美在线观看天堂一区二区三区| 美脚丝袜一区二区三区在线观看| 亚洲精品一品区二品区三品区| 亚洲天堂网在线观看| 巨乳诱惑日韩免费av| 国产精品毛片| 亚洲精品乱码久久久久久蜜桃麻豆| 亚洲一区综合| 亚洲国产精品国自产拍av秋霞 | 亚洲大片免费看| 欧美国产日韩免费| av成人免费| 久久婷婷久久一区二区三区| 欧美三级欧美一级| 亚洲欧洲日本一区二区三区| 欧美中文字幕第一页| 日韩一区二区精品| 欧美成人一区二区三区在线观看| 国产一区二区三区的电影| 一本色道久久综合亚洲精品不| 欧美91精品| 久久国产黑丝| 国产精品推荐精品| 亚洲欧美日韩国产中文| 99精品欧美一区二区三区综合在线 | 久久国产精品久久久| 国产精品xnxxcom| 亚洲美女在线视频| 欧美福利精品| 米奇777超碰欧美日韩亚洲| 国产日韩精品久久久| 午夜精品久久久久久久久久久| 亚洲美女视频在线免费观看| 欧美激情一区在线观看| 亚洲全部视频| 亚洲人成网在线播放| 欧美日韩美女在线观看| 一区二区三区成人精品| 一本色道久久88亚洲综合88| 欧美日韩一区成人| 亚洲欧美激情在线视频| 亚洲在线网站| 韩日在线一区| 欧美成年视频| 欧美欧美在线| 午夜欧美大片免费观看| 西瓜成人精品人成网站| 激情欧美丁香| 亚洲黑丝一区二区| 欧美三级特黄| 欧美专区日韩专区| 久久综合九色综合欧美就去吻| 亚洲欧洲精品一区二区三区波多野1战4| 欧美91大片| 欧美日韩国产综合在线| 亚洲一区尤物| 久久久精品日韩| 日韩亚洲视频| 亚洲欧美三级伦理| 亚洲黄色性网站| 在线视频精品| 韩国亚洲精品| 亚洲精品乱码久久久久久蜜桃91 | 亚洲精品极品| 亚洲在线国产日韩欧美| 午夜精品999| 在线成人欧美| 99视频一区| 韩国成人福利片在线播放| 欧美激情视频一区二区三区免费| 欧美日韩精品一区二区三区| 欧美与黑人午夜性猛交久久久| 久久久激情视频| 亚洲欧美日本另类| 久久久999成人| 夜夜嗨av一区二区三区网页| 午夜精品视频在线观看| 亚洲人成亚洲人成在线观看| 亚洲欧美日韩国产成人| 日韩视频精品在线| 欧美自拍偷拍午夜视频| 在线亚洲精品| 久色成人在线| 久久精品一区二区三区不卡| 欧美成人精品激情在线观看| 欧美伊人久久久久久久久影院| 欧美成人精品1314www| 久久久av水蜜桃| 国产精品久久影院| 91久久精品国产91久久性色tv | 国产乱理伦片在线观看夜一区| 欧美激情中文不卡| 国产在线不卡精品| 亚洲一区二区三区在线| 一区二区三区四区蜜桃| 欧美mv日韩mv国产网站app| 久久精品人人做人人综合| 国产精品成av人在线视午夜片| 亚洲成人资源网| 在线观看一区视频| 久久精品在这里| 另类国产ts人妖高潮视频| 国产欧美日韩一区二区三区| 一区二区三区产品免费精品久久75| 亚洲精品国产日韩| 免费看的黄色欧美网站| 美日韩精品免费| 亚洲电影免费在线| 美女网站在线免费欧美精品| 久久综合九色综合网站| 好吊视频一区二区三区四区| 欧美一区二区视频在线观看| 久久精品亚洲乱码伦伦中文 | 欧美成人国产va精品日本一级| 蜜臀av性久久久久蜜臀aⅴ| 韩日精品视频一区| 久久综合中文字幕| 亚洲国产欧美一区| 一区二区三区国产在线| 欧美午夜精品理论片a级按摩| 99精品久久久| 欧美一区二区三区久久精品茉莉花| 国产精品女人毛片| 欧美一区二区高清| 欧美成人免费全部| 亚洲作爱视频| 中国女人久久久| 欧美亚洲三级| 久久这里只有精品视频首页| 亚洲欧洲99久久| 欧美性色aⅴ视频一区日韩精品| 亚洲经典在线看| 91久久久久久久久| 久久影视精品| 亚洲人成啪啪网站| 中文久久精品| 国产精品久久久久毛片大屁完整版 | 久久精品视频导航| 国内外成人在线| 久久婷婷人人澡人人喊人人爽| 欧美大片免费观看在线观看网站推荐| 亚洲激情在线观看| 国产精品xvideos88| 欧美一级播放| 亚洲国产精品第一区二区| 亚洲一区视频在线观看视频| 国产主播在线一区| 欧美成人午夜77777| 亚洲午夜在线| 亚洲第一二三四五区| 性色一区二区| 最近中文字幕mv在线一区二区三区四区 | 性欧美办公室18xxxxhd| 今天的高清视频免费播放成人| 欧美精品亚洲| 久久久久国产精品午夜一区| 99精品热6080yy久久| 欧美高清在线观看| 欧美一区视频在线| 艳妇臀荡乳欲伦亚洲一区| 国产综合视频| 欧美视频一区在线观看| 米奇777在线欧美播放| 性欧美videos另类喷潮| a91a精品视频在线观看| 欧美激情在线播放| 久久香蕉国产线看观看av| 亚洲午夜电影在线观看| 亚洲国产影院| 狠狠操狠狠色综合网| 国产伦精品一区二区三区高清| 欧美连裤袜在线视频| 欧美ed2k| 免费在线看成人av| 蜜桃av一区二区在线观看|