部分和问题描述
给定整数a1、a2、…….an,判断是否可以从中选出若干数,使它们的和恰好为K。输入
首先,n和k,n表示数的个数,k表示数的和。
接着一行n个数。
(1<=n<=20,保证不超int范围)
输出
如果和恰好可以为k,输出“YES”,并按输入顺序依次输出是由哪几个数的和组成,否则“NO”
样例输入4 13
1 2 4 7
样例输出...
分类:
其他好文 时间:
2015-03-21 22:58:45
阅读次数:
231
找点时间限制:2000ms | 内存限制:65535KB难度:2描写叙述上数学课时,老师给了LYH一些闭区间,让他取尽量少的点,使得每一个闭区间内至少有一个点。可是这几天LYH太忙了,你们帮帮他吗?输入多组測试数据。每组数据先输入一个N,表示有N个闭区间(N≤100)。接下来N行,每行输入两个数a,...
分类:
其他好文 时间:
2015-03-21 12:37:32
阅读次数:
130
链接:click here~~
题意:
描述
Many of us had played the game "Battle city" in our childhood, and some people (like me) even often play it on computer now.
What we are discussing is a simple edition...
分类:
其他好文 时间:
2015-03-20 23:52:07
阅读次数:
452
比大小时间限制:3000ms | 内存限制:65535KB难度:2描述给你两个很大的数,你能不能判断出他们两个数的大小呢?比如123456789123456789要大于-123456输入每组测试数据占一行,输入两个不超过1000位的10进制整数a,b数据保证输入的a,b没有前缀的0。如果输入0 0表...
分类:
其他好文 时间:
2015-03-20 20:11:02
阅读次数:
175
cigarettes
时间限制:3000 ms | 内存限制:65535 KB
难度:2
描述
Tom has many cigarettes. We hypothesized that he has n cigarettes and smokes them
one by one keeping all the butts. Out of k > 1 butts he ca...
分类:
其他好文 时间:
2015-03-19 22:14:10
阅读次数:
132
Coin Test
时间限制:3000 ms | 内存限制:65535 KB
难度:1
描述
As is known to all,if you throw a coin up and let it droped on the desk there are usually three results. Yes,just believe what I say ~it can be...
分类:
其他好文 时间:
2015-03-19 22:12:27
阅读次数:
111
汉诺塔(三)
时间限制:3000 ms | 内存限制:65535 KB
难度:3
描述
在印度,有这么一个古老的传说:在世界中心贝拿勒斯(在印度北部)的圣庙里,一块黄铜板上插着三根宝石针。印度教的主神梵天在创造世界的时候,在其中一根针上从下到上地穿好了由大到小的64片金片,这就是所谓的汉诺塔。不论白天黑夜,总有一个僧侣在按照下面的法则移动这些金片:一次只移动一片...
分类:
其他好文 时间:
2015-03-18 20:33:45
阅读次数:
176
24 Point game
时间限制:3000 ms | 内存限制:65535 KB
难度:5
描述
There is a game which is called 24 Point game.
In this game , you will be given some numbers. Your task is to find an expressi...
分类:
其他好文 时间:
2015-03-18 20:33:13
阅读次数:
184
求次数
时间限制:1000 ms | 内存限制:65535 KB
难度:2
描述
题意很简单,给一个数n 以及一个字符串str,区间【i,i+n-1】 为一个新的字符串,i 属于【0,strlen(str)】如果新的字符串出现过ans++,例如:acmacm n=3,那么 子串为acm cma mac acm ,只有acm出现过
求ans;
输入...
分类:
其他好文 时间:
2015-03-18 20:32:23
阅读次数:
121
表达式求值时间限制:3000ms | 内存限制:65535KB难度:3描述Dr.Kong设计的机器人卡多掌握了加减法运算以后,最近又学会了一些简单的函数求值,比如,它知道函数min(20,23)的值是20,add(10,98)的值是108等等。经过训练,Dr.Kong设计的机器人卡多甚至会计算一种嵌...
分类:
其他好文 时间:
2015-03-18 15:29:09
阅读次数:
195