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

posts - 74,  comments - 33,  trackbacks - 0
Balance
Time Limit: 1000MS Memory Limit: 30000K
Total Submissions: 1159 Accepted: 553

Description

Gigel has a strange "balance" and he wants to poise it. Actually, the device is different from any other ordinary balance.
It orders two arms of negligible weight and each arm's length is 15. Some hooks are attached to these arms and Gigel wants to hang up some weights from his collection of G weights (1 <= G <= 20) knowing that these weights have distinct values in the range 1..25. Gigel may droop any weight of any hook but he is forced to use all the weights.
Finally, Gigel managed to balance the device using the experience he gained at the National Olympiad in Informatics. Now he would like to know in how many ways the device can be balanced.

Knowing the repartition of the hooks and the set of the weights write a program that calculates the number of possibilities to balance the device.
It is guaranteed that will exist at least one solution for each test case at the evaluation.

Input

The input has the following structure:
? the first line contains the number C (2 <= C <= 20) and the number G (2 <= G <= 20);
? the next line contains C integer numbers (these numbers are also distinct and sorted in ascending order) in the range -15..15 representing the repartition of the hooks; each number represents the position relative to the center of the balance on the X axis (when no weights are attached the device is balanced and lined up to the X axis; the absolute value of the distances represents the distance between the hook and the balance center and the sign of the numbers determines the arm of the balance to which the hook is attached: '-' for the left arm and '+' for the right arm);
? on the next line there are G natural, distinct and sorted in ascending order numbers in the range 1..25 representing the weights' values.

Output

The output contains the number M representing the number of possibilities to poise the balance.

Sample Input

2 4	
-2 3 
3 4 5 8

Sample Output

2

Source

Romania OI 2002
郁悶了,dp不會了 昨天吃晚飯回來就做,到走才知道題目意思看錯了,《岳陽樓記》也不會了
。。。。。郁悶,代碼很爛,不發(fā)了
posted on 2009-02-20 09:25 KNIGHT 閱讀(277) 評論(0)  編輯 收藏 引用

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


<2009年4月>
2930311234
567891011
12131415161718
19202122232425
262728293012
3456789

常用鏈接

留言簿(8)

隨筆檔案

文章檔案

Friends

OJ

搜索

  •  

最新評論

閱讀排行榜

評論排行榜

青青草原综合久久大伊人导航_色综合久久天天综合_日日噜噜夜夜狠狠久久丁香五月_热久久这里只有精品
  • <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| 国产欧美日韩在线| 欧美精品激情blacked18| 亚洲免费视频一区二区| 亚洲最新在线视频| 亚洲精品视频二区| 一区二区激情视频| 亚洲尤物视频在线| 亚洲一区二区三区中文字幕在线 | 国产精品夜色7777狼人| 欧美色精品天天在线观看视频| 欧美xart系列高清| 欧美日本在线视频| 国产精品久久一区二区三区| 国产精品久久久一区二区| 国产精品三区www17con| 国产午夜精品理论片a级大结局| 国产美女精品| 亚洲激情综合| 午夜视频在线观看一区二区| 久久久久久9999| 最新日韩中文字幕| 亚洲一区二区成人| 久久综合给合久久狠狠色| 欧美区视频在线观看| 国产日韩欧美三级| 在线中文字幕日韩| 久久免费视频在线| 欧美亚州在线观看| 亚洲人体偷拍| 男女激情视频一区| 欧美专区日韩专区| 国产精品腿扒开做爽爽爽挤奶网站| 玉米视频成人免费看| 午夜久久黄色| 一区二区三区免费看| 欧美.www| 亚洲精品视频一区二区三区| 久久女同精品一区二区| 亚洲欧美日韩精品久久| 国产精品v欧美精品∨日韩| 亚洲国产高清一区二区三区| 久久这里有精品视频| 午夜精品视频一区| 国产麻豆日韩| 久久av在线看| 久久精品国产免费观看| 国产一区在线免费观看| 香蕉久久夜色| 久久久福利视频| 在线看日韩av| 亚洲精品乱码久久久久久按摩观| 欧美va亚洲va日韩∨a综合色| 亚洲第一中文字幕在线观看| 亚洲韩国精品一区| 国产精品女同互慰在线看| 久久精品国产一区二区三| 久久乐国产精品| 中文欧美日韩| 久久久久久网| 亚洲欧美一区在线| 欧美中文字幕在线视频| 久久夜色精品一区| 亚洲永久在线观看| 久久久人人人| 亚洲一区二区成人| 免费在线一区二区| 欧美亚洲免费在线| 欧美另类极品videosbest最新版本| 亚洲一区二区三区在线看| 久久久久国产成人精品亚洲午夜| 亚洲精品在线观看视频| 欧美夜福利tv在线| 欧美亚洲三级| 欧美午夜视频在线| 9l国产精品久久久久麻豆| 每日更新成人在线视频| 欧美成年人网站| 国产午夜精品一区理论片飘花 | 裸体歌舞表演一区二区| 亚洲欧美激情精品一区二区| 欧美高清自拍一区| 亚洲国产成人在线视频| 亚洲经典在线| 免费在线欧美视频| 亚洲欧洲日本在线| 亚洲午夜三级在线| 国产精品呻吟| 欧美一区二区三区免费视频 | 国产精品日韩欧美大师| 中文在线不卡视频| 亚洲欧美国产精品专区久久| 国产精品v片在线观看不卡 | 久久成人18免费网站| 欧美电影在线| 欧美大片免费看| 久久精品二区三区| 伊人久久大香线蕉av超碰演员| 一区二区三区成人| 亚洲欧美一区二区视频| 国产综合色产| 欧美日韩在线播放三区四区| 校园激情久久| 夜夜嗨av色综合久久久综合网| 亚洲欧美影院| 亚洲精品国精品久久99热| 欧美三级免费| 欧美成人视屏| 久久久99久久精品女同性| 99精品欧美| 99精品99久久久久久宅男| 另类国产ts人妖高潮视频| 亚洲一区在线视频| 亚洲精选成人| 亚洲黄色av一区| 在线看国产一区| 国产日韩欧美日韩| 国产精品视频xxxx| 国产精品日韩专区| 国产精品久久久久久久第一福利| 嫩草国产精品入口| 免费国产一区二区| 久久免费视频网站| 欧美成人免费播放| 欧美激情久久久久久| 欧美二区不卡| 国产精品qvod| 国产午夜亚洲精品理论片色戒| 国产精品一区二区在线| 国产精品中文字幕欧美| 国产午夜精品久久久久久久| 黑人中文字幕一区二区三区| 亚洲电影免费在线| 亚洲图片激情小说| 国产精品久久久久久久午夜| 欧美性jizz18性欧美| 国产自产高清不卡| 亚洲激情网址| 欧美一区二区日韩| 欧美高潮视频| 亚洲一区二区三区涩| 久久久久五月天| 国产精品理论片在线观看| 在线日韩中文| 午夜精品视频一区| 欧美国产专区| 久久久最新网址| 国产亚洲激情视频在线| 亚洲久色影视| 欧美激情精品久久久久久黑人 | 亚洲永久免费视频| 久久天天躁狠狠躁夜夜av| 欧美日韩高清在线播放| 亚洲国产婷婷香蕉久久久久久| 亚洲视频在线观看三级| 欧美激情一区二区三级高清视频| 欧美影院在线播放| 国产日韩欧美二区| 久久久高清一区二区三区| 亚洲一线二线三线久久久| 欧美日韩国产123| 亚洲欧美另类在线观看| 一区二区三区日韩精品视频| 欧美日本高清视频| 中国亚洲黄色| 亚洲夜晚福利在线观看| 久久久久久午夜| 久久久久女教师免费一区| 亚洲欧美日韩在线观看a三区| 国产精品一区二区久激情瑜伽| 欧美主播一区二区三区| 欧美一区二区三区视频| 国模套图日韩精品一区二区| 欧美视频在线看| 小黄鸭精品密入口导航| 欧美在线地址| 亚洲国内自拍| 亚洲在线观看视频网站| 黄色国产精品| 99re视频这里只有精品| 欧美肉体xxxx裸体137大胆| 亚洲欧美日韩在线高清直播| 香蕉久久一区二区不卡无毒影院| 在线观看视频欧美| 亚洲欧美国产视频| 在线午夜精品| 免费亚洲电影在线| 久久精品色图| 国产精品一区二区久久| 亚洲精品一区中文| 亚洲人午夜精品| 欧美中文在线字幕| 欧美一区二区三区在线看| 欧美精品在线观看91| 欧美激情1区| 91久久久国产精品| 欧美成人xxx| 亚洲精品女人| 亚洲高清视频的网址|