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

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成人免费| 国产精品va在线播放| 米奇777超碰欧美日韩亚洲| 亚洲一区影院| 亚洲一级在线| 亚洲免费在线视频一区 二区| 一区二区三区四区国产| 亚洲无人区一区| 小处雏高清一区二区三区| 亚洲欧美日韩另类| 欧美一级欧美一级在线播放| 久久精品水蜜桃av综合天堂| 麻豆精品传媒视频| 亚洲欧洲日产国产网站| 亚洲国产一区二区三区a毛片| 99riav久久精品riav| 亚洲欧美日韩国产成人| 久久久精品国产免费观看同学 | 99精品免费网| 亚洲一区精品电影| 久久久青草婷婷精品综合日韩| 欧美激情2020午夜免费观看| 9i看片成人免费高清| 亚洲男人第一av网站| 久久综合综合久久综合| 久久久久久免费| 欧美成人精品| 亚洲欧美日韩区| 欧美第一黄色网| 国产乱码精品| 日韩一区二区精品| 久久三级福利| 一区二区福利| 欧美成人免费观看| 国产一区二区三区在线观看免费视频| 亚洲国产一区二区在线| 欧美一区二区三区啪啪| 亚洲国产日韩欧美| 欧美在线国产精品| 欧美母乳在线| 91久久精品国产91性色tv| 久久av一区二区三区| 亚洲毛片一区| 欧美成人国产| 亚洲成色www8888| 久久精品国产96久久久香蕉| 一本色道久久综合亚洲精品按摩| 欧美大片91| 亚洲国产cao| 美女精品在线观看| 午夜精品久久一牛影视| 国产精品久久国产精品99gif| 亚洲免费观看| 亚洲第一页中文字幕| 亚洲性感美女99在线| 欧美三级电影一区| 国产精品99久久99久久久二8| 亚洲国产高清一区| 欧美大片一区| 99国内精品久久久久久久软件| 欧美国产日韩亚洲一区| 浪潮色综合久久天堂| 在线观看成人网| 欧美国产极速在线| 蜜臀va亚洲va欧美va天堂| 一区久久精品| 亚洲大胆女人| 欧美极品在线播放| 亚洲手机在线| 亚洲日本在线观看| 欧美日韩一区二| 亚洲永久网站| 午夜精品在线看| 狠狠色丁香婷婷综合影院 | 亚洲第一毛片| 欧美国产日韩在线观看| 一本色道久久综合亚洲精品不卡| 亚洲美女在线观看| 国产精品青草综合久久久久99 | 午夜一级在线看亚洲| 亚洲综合日韩中文字幕v在线| 在线看片日韩| 日韩一级在线观看| 尤妮丝一区二区裸体视频| 99在线热播精品免费| 欧美国产日韩视频| 欧美jjzz| 亚洲午夜精品久久久久久浪潮| 欧美激情亚洲一区| 欧美日韩亚洲高清一区二区| 亚洲一区在线免费| 久久精品亚洲精品国产欧美kt∨| 亚洲国产日韩综合一区| 日韩亚洲欧美成人一区| 国产一区二区三区免费不卡| 欧美mv日韩mv国产网站| 欧美精品在线免费| 久久精品在线视频| 欧美精品91| 久久国产综合精品| 欧美国产日韩一区二区三区| 性做久久久久久| 免费成人黄色片| 亚洲一区二区三区免费视频| 久久精品人人做人人综合| 99成人精品| 欧美在线国产精品| 亚洲视频在线观看一区| 久久久久在线| 国产精品成人一区| 国产精品色午夜在线观看| 久久精品在线视频| 欧美精品成人在线| 久久精品一区中文字幕| 欧美精品免费播放| 亚洲无线视频| 久久久久久久久一区二区| 嫩草伊人久久精品少妇av杨幂| 亚洲免费一级电影| 欧美成人亚洲成人日韩成人| 欧美亚洲三级| 欧美久久久久久久久久| 蜜桃av一区| 国产麻豆精品theporn| 亚洲精品国产精品乱码不99| 久久久一区二区| 久久免费一区| 欧美激情1区| 久久av一区二区三区| 葵司免费一区二区三区四区五区| 午夜国产精品视频| 欧美日本一区二区视频在线观看| 女生裸体视频一区二区三区| 国产精品三区www17con| 99精品欧美| 亚洲精品久久久久久一区二区| 久久久久久久网| 久久久久高清| 欧美电影免费观看大全| 欧美国产成人在线| 久久九九国产| 欧美一区2区三区4区公司二百| 亚洲精选视频免费看| 久久视频这里只有精品| 久久精品亚洲国产奇米99| 国产欧美午夜| 欧美在线三级| 久久久久久久一区二区| 国产午夜精品视频| 欧美在线视频全部完| 久久免费视频网| 国产亚洲欧美另类一区二区三区| 亚洲欧美视频在线观看视频| 久久大香伊蕉在人线观看热2| 国产精品永久在线| 欧美在线啊v一区| 免费在线观看成人av| 亚洲国产视频一区| 欧美精品一区视频| 亚洲网友自拍| 欧美日韩免费网站| 久久综合狠狠综合久久激情| 久久精品91久久香蕉加勒比| 国产午夜精品视频免费不卡69堂| 欧美一区二区日韩| 麻豆免费精品视频| 亚洲精品视频免费| 欧美日韩日本网| 亚洲一区二区三区色| 久久精品亚洲乱码伦伦中文| 亚洲二区三区四区| 欧美日韩中文字幕综合视频 | 99热在这里有精品免费| 亚洲欧美一区二区在线观看| 国产一区二区精品久久99| 久久蜜桃资源一区二区老牛| 亚洲日本理论电影| 欧美在线高清| 欧美伊人久久久久久久久影院| 一区二区三区国产在线| 欧美人与性动交cc0o| 久久一区二区三区av| 麻豆精品一区二区av白丝在线| 亚洲国产专区| 国产精品亚洲综合久久| 亚洲在线国产日韩欧美| 噜噜噜躁狠狠躁狠狠精品视频| 99国产精品久久久久久久久久 | 亚洲一线二线三线久久久| 国产在线不卡| 欧美日韩在线电影| 久久久久国内| av不卡在线| 欧美日韩一区二区三区免费| 久久久久久久久久久久久9999| 一本色道久久综合精品竹菊| 精品成人久久| 国产精品视频你懂的| 欧美精品一区二区三区在线看午夜| 欧美一区二区三区免费视|