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

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

只有注冊用戶登錄后才能發表評論。
網站導航: 博客園   IT新聞   BlogJava   博問   Chat2DB   管理


<2009年2月>
25262728293031
1234567
891011121314
15161718192021
22232425262728
1234567

常用鏈接

留言簿(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>
            久久黄色级2电影| 国产精品入口麻豆原神| 一区二区三区国产| 99re6热只有精品免费观看| 欧美视频免费看| 亚洲专区国产精品| 午夜精品久久久久久| 国产午夜精品久久| 媚黑女一区二区| 欧美电影资源| 一区二区三区鲁丝不卡| 亚洲一区二区三区乱码aⅴ| 国产日韩三区| 欧美激情视频在线播放 | 国产毛片精品国产一区二区三区| 欧美在线视频不卡| 久久夜色精品国产亚洲aⅴ| 午夜精品一区二区三区在线视| 久久九九久精品国产免费直播 | 亚洲欧洲免费视频| 欧美凹凸一区二区三区视频| 亚洲香蕉伊综合在人在线视看| 亚洲男人的天堂在线观看| 韩国精品在线观看| 亚洲精品极品| 国产女主播一区二区| 欧美成人嫩草网站| 欧美天堂亚洲电影院在线播放| 久久精品亚洲乱码伦伦中文 | 亚洲欧洲日韩在线| 国产精品免费看片| 欧美xart系列在线观看| 欧美午夜精品理论片a级大开眼界| 久久精品盗摄| 欧美国产视频一区二区| 香蕉成人久久| 欧美不卡高清| 欧美一区二区三区视频| 老司机精品福利视频| 亚洲一区二区在线播放| 久久人人爽人人| 亚洲一区二区三区涩| 久久久久久久尹人综合网亚洲| 这里只有精品视频| 久久精品国产第一区二区三区| 99视频一区| 久久国产精品72免费观看| 99精品视频免费| 久久精品亚洲| 亚洲欧美另类在线| 免费影视亚洲| 欧美在线1区| 欧美日韩国语| 免费成人你懂的| 国产精品久久久免费| 亚洲国产精品传媒在线观看| 国产一区二区三区免费不卡| 日韩视频在线一区二区三区| 亚洲盗摄视频| 午夜精品成人在线视频| 夜夜嗨网站十八久久| 久久午夜激情| 久久国产精品久久精品国产| 欧美日韩不卡| 久久久人人人| 国产精品爽黄69| 亚洲三级视频| 亚洲黄色免费| 久久精品国产一区二区电影| 亚洲欧美综合网| 欧美日韩国产色综合一二三四| 免费欧美在线视频| 国产日韩精品入口| 亚洲精品在线观看免费| 欧美激情精品| 狠狠色综合网| 翔田千里一区二区| 亚洲专区一区二区三区| 欧美精品国产精品日韩精品| 久久综合婷婷| 国产一区二区0| 亚洲嫩草精品久久| 亚洲网址在线| 欧美美女操人视频| 亚洲国产成人不卡| 国内精品久久久久伊人av| 亚洲综合精品自拍| 亚洲欧美成人一区二区三区| 欧美日韩精品免费看| 亚洲国产专区| 亚洲黄色小视频| 狂野欧美一区| 久久综合成人精品亚洲另类欧美| 国产精品视频一二三| 亚洲小说春色综合另类电影| 中文国产亚洲喷潮| 欧美日韩免费在线视频| 亚洲欧洲一区二区在线播放| 亚洲精品婷婷| 欧美成人免费全部观看天天性色| 欧美www视频在线观看| 亚洲电影免费观看高清完整版在线| 欧美一区二区黄| 欧美专区在线| 国产午夜精品理论片a级大结局| 亚洲综合电影| 欧美尤物一区| 国产综合久久久久久| 久久国产精品久久久久久久久久| 久久精品国产99精品国产亚洲性色| 国产精品最新自拍| 香蕉成人久久| 久久免费高清| 极品尤物一区二区三区| 久久久爽爽爽美女图片| 欧美aa国产视频| 亚洲激情二区| 欧美另类人妖| 在线亚洲精品| 欧美一级大片在线免费观看| 国产精品视频xxxx| 欧美一区二区三区在线观看视频| 久久精品国内一区二区三区| 国产视频亚洲精品| 欧美在线播放视频| 男女精品视频| 日韩亚洲精品电影| 欧美午夜电影在线| 亚洲欧美综合v| 玖玖综合伊人| 亚洲人成艺术| 欧美午夜精品伦理| 欧美亚洲视频一区二区| 麻豆成人综合网| 亚洲精品乱码久久久久久蜜桃91| 欧美日韩免费一区二区三区视频| 一区二区欧美视频| 欧美一二三区精品| 国产亚洲欧美一级| 久久99伊人| 国产精品第2页| 欧美一区午夜精品| 欧美国产视频一区二区| av成人毛片| 国产欧美欧美| 两个人的视频www国产精品| 亚洲精品中文字幕在线| 亚洲欧美在线视频观看| 国语精品中文字幕| 欧美电影专区| 亚洲欧美区自拍先锋| 毛片av中文字幕一区二区| 日韩亚洲精品电影| 国产欧美一区二区精品性| 久久夜色精品亚洲噜噜国产mv| 亚洲毛片在线观看| 欧美亚洲在线| 在线观看亚洲专区| 欧美视频国产精品| 久久国产精品72免费观看| 亚洲精品国产精品国产自| 性欧美精品高清| 亚洲国产三级网| 国产精品嫩草99av在线| 久久三级视频| 中文一区字幕| 欧美jizzhd精品欧美巨大免费| 亚洲一区二区三区乱码aⅴ| 国产一区二区精品久久| 欧美精品免费播放| 欧美亚洲一区二区在线| 亚洲国产综合视频在线观看| 欧美在线亚洲综合一区| 亚洲精品在线电影| 国产最新精品精品你懂的| 欧美人牲a欧美精品| 久久精品男女| 一区二区三区不卡视频在线观看| 蜜桃久久精品一区二区| 亚洲一区一卡| 亚洲欧洲一区二区在线播放| 国产精品一卡二卡| 免费黄网站欧美| 午夜精品久久| 一区二区三区精密机械公司 | 亚洲伦理在线免费看| 国产日韩欧美亚洲| 欧美日韩国产美| 久久婷婷综合激情| 亚洲欧美日韩国产综合精品二区| 亚洲国产日韩在线一区模特| 久久av二区| 亚洲一区二区成人| 亚洲精品无人区| 在线观看一区视频| 国产精品影片在线观看| 欧美日韩国产另类不卡| 欧美阿v一级看视频| 久久精品亚洲一区二区三区浴池| 亚洲天堂激情|