#include <iostream>
#include <cstdio>
#include <cstring>
#include <cmath>
#include <algorithm>
#include <string>
#include <vector>
#include <map>
#include <set>
#include <time.h>
#include <queue>
#include <stack>
#include <cctype>
#include <utility>
#include <numeric>
#include <cstdlib>
#include <functional>
#include <iomanip>
#include <sstream>
using namespace std;
int n,k,s;
int ans;
void gao(int now,int deep,int sum)
{
if(deep==k&&sum==s) {ans++;return ;}
if(deep>k||sum>s) return ;
else
for(int i=now+;i<=n;i++)
gao(i,deep+,sum+i);
return ;
}
int main()
{ while(scanf("%d%d%d",&n,&k,&s)!=EOF)
{
if(n+k+s==) break;
ans=;
for(int i=;i<=n;i++)
gao(i,,i);
printf("%d\n",ans);
}
return ;
}

UVALive 6661 Equal Sum Sets的更多相关文章

  1. UvaLive 6661 Equal Sum Sets (DFS)

    Let us consider sets of positive integers less than or equal to n. Note that all elements of a set a ...

  2. [UVALive 6661 Equal Sum Sets] (dfs 或 dp)

    题意: 求从不超过 N 的正整数其中选取 K 个不同的数字,组成和为 S 的方法数. 1 <= N <= 20  1 <= K<= 10  1 <= S <= 15 ...

  3. D.6661 - Equal Sum Sets

    Equal Sum Sets Let us consider sets of positive integers less than or equal to n. Note that all elem ...

  4. UvaLive6661 Equal Sum Sets dfs或dp

    UvaLive6661 PDF题目 题意:让你用1~n中k个不同的数组成s,求有多少种组法. 题解: DFS或者DP或打表. 1.DFS 由于数据范围很小,直接dfs每种组法统计个数即可. //#pr ...

  5. Equal Sum Sets

    题目链接:http://acm.hust.edu.cn/vjudge/problem/viewProblem.action?id=49406 题意: 输入n,k,s,求在不小于n的数中找出k个不同的数 ...

  6. HDU-3280 Equal Sum Partitions

    http://acm.hdu.edu.cn/showproblem.php?pid=3280 用了简单的枚举. Equal Sum Partitions Time Limit: 2000/1000 M ...

  7. HDU 3280 Equal Sum Partitions(二分查找)

    Equal Sum Partitions Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Oth ...

  8. 698. Partition to K Equal Sum Subsets

    Given an array of integers nums and a positive integer k, find whether it's possible to divide this ...

  9. [LeetCode] 548. Split Array with Equal Sum 分割数组成和相同的子数组

    Given an array with n integers, you need to find if there are triplets (i, j, k) which satisfies fol ...

随机推荐

  1. 怎么看innodb的B+TREE层数?

    怎么看innodb的B+TREE层数?,下面以sysbench_testdata.sbtest2为例查看索引层数: - 查看相关系统 root@localhost [sysbench_testdata ...

  2. 十一、springboot之web开发之Filter

    我们常常在项目中会使用filters用于录调用日志.排除有XSS威胁的字符.执行权限验证等等.Spring Boot自动添加了OrderedCharacterEncodingFilter和Hidden ...

  3. 将ipa文件安装到测试设备上的几种方法

    Installing Your App on Test Devices Using Xcode You can install iOS App files on devices using Xcode ...

  4. 【轨迹动画css】不规则轨迹动画css教程,弹球,客服广告悬浮层都可以用

    小demo如下,可更具自己需求修改: css @keyframes animX{ 0% {left: 0px;} 100% {left: 500px;} } @keyframes animY{ 0% ...

  5. 3.Springboot之修改启动时的默认图案Banner

    一.SpringBoot的默认启动图案 在SpringBoot启动的时候,默认的会展示出一个spring的logo,这个图案我们用户是可以自定义的 二.自定义启动图案 方法一: Application ...

  6. 洛谷P3366最小生成树

    传送门啦 #include <iostream> #include <cstdio> #include <cstring> #include <algorit ...

  7. gif处理

    UleadGIFAnimator-v5.05破解版 网盘地址:https://pan.baidu.com/s/1bpf6iVP 2017-02-19  10:39:58

  8. HBase(六)HBase整合Hive,数据的备份与MR操作HBase

    一.数据的备份与恢复 1. 备份 停止 HBase 服务后,使用 distcp 命令运行 MapReduce 任务进行备份,将数据备份到另一个地方,可以是同一个集群,也可以是专用的备份集群. 即,把数 ...

  9. Spark(八)JVM调优以及GC垃圾收集器

    一JVM结构 1 Java内存结构 JVM内存结构主要有三大块:堆内存.方法区和栈. 堆内存是JVM中最大的一块由年轻代和老年代组成,而年轻代内存又被分成三部分,Eden空间.From Survivo ...

  10. Spark(七)Spark内存调优

    一.概述 Spark 作为一个基于内存的分布式计算引擎,其内存管理模块在整个系统中扮演着非常重要的角色.理解 Spark 内存管理的基本原理,有助于更好地开发 Spark 应用程序和进行性能调优.本文 ...