Experimental Educational Round: VolBIT Formulas Blitz F
Description
One company of IT City decided to create a group of innovative developments consisting from 5 to 7 people and hire new employees for it. After placing an advertisment the company received n resumes. Now the HR department has to evaluate each possible group composition and select one of them. Your task is to count the number of variants of group composition to evaluate.
The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes.
Output one integer — the number of different variants of group composition.
7
29
从n个人中选5,6,7个一共多少种选法
#include<stdio.h>
//#include<bits/stdc++.h>
#include<string.h>
#include<iostream>
#include<math.h>
#include<sstream>
#include<set>
#include<queue>
#include<map>
#include<vector>
#include<algorithm>
#include<limits.h>
#define inf 0x7fffffff
#define INF 0x7fffffffffffffff
#define lson l,m,rt<<1
#define rson m+1,r,rt<<1|1
#define LL long long
#define ULL unsigned long long
using namespace std;
LL n;
ULL C(int n,int m)
{
if(n<m) return 0;
ULL ans=1;
for(int i=0;i<m;i++) ans=ans*(ULL)(n-i)/(ULL)(i+1);
return ans;
}
ULL A(int n,int m)
{
if(n<m) return 0;
ULL ans=1;
for(int i=0;i<m;i++) ans*=(ULL)(n-i);
return ans;
}
int main()
{
cin>>n;
cout<<C(n,5)+C(n,6)+C(n,7)<<endl;
return 0;
}
Experimental Educational Round: VolBIT Formulas Blitz F的更多相关文章
- Experimental Educational Round: VolBIT Formulas Blitz
cf的一次数学场... 递推 C 题意:长度<=n的数只含有7或8的个数 分析:每一位都有2种可能,累加不同长度的方案数就是总方案数 组合 G 题意:将5个苹果和3个梨放进n个不同的盒子里的方案 ...
- Experimental Educational Round: VolBIT Formulas Blitz K
Description IT City company developing computer games decided to upgrade its way to reward its emplo ...
- Experimental Educational Round: VolBIT Formulas Blitz N
Description The Department of economic development of IT City created a model of city development ti ...
- Experimental Educational Round: VolBIT Formulas Blitz J
Description IT City company developing computer games invented a new way to reward its employees. Af ...
- Experimental Educational Round: VolBIT Formulas Blitz D
Description After a probationary period in the game development company of IT City Petya was include ...
- Experimental Educational Round: VolBIT Formulas Blitz C
Description The numbers of all offices in the new building of the Tax Office of IT City will have lu ...
- Experimental Educational Round: VolBIT Formulas Blitz B
Description The city administration of IT City decided to fix up a symbol of scientific and technica ...
- Experimental Educational Round: VolBIT Formulas Blitz A
Description The HR manager was disappointed again. The last applicant failed the interview the same ...
- Experimental Educational Round: VolBIT Formulas Blitz K. Indivisibility —— 容斥原理
题目链接:http://codeforces.com/contest/630/problem/K K. Indivisibility time limit per test 0.5 seconds m ...
随机推荐
- 一段PHP异常
这是我写的一段代码,里面通过PHP异常功能,实现报错时显示出错代码所在行.当使用者操作出错时,截图给我,我可以很快得去追踪和排查错误! public function added_business_s ...
- [poj2398]Toy Storage
接替关键:和上题类似,输出不同,注意输入这道题需要排序. #include<cstdio> #include<cstring> #include<algorithm> ...
- sg值的求解(NIM)
硬币游戏2 挑战程序设计竞赛P315 1堆的情况: #include<bits/stdc++.h> ,grundy[],k=,A[]={,},n=; using namespace std ...
- Python02 标准输入输出、数据类型、变量、随记数的生成、turtle模块详解
1 标准输出 python3利用 print() 来实现标准输出 def print(self, *args, sep=' ', end='\n', file=None): # known speci ...
- ann
转自 http://blog.csdn.net/yiluoyan/article/details/45308785 这篇文章接着之前的车牌识别,从输入的车图片中分割识别出车牌之后,将进行下一步:车牌号 ...
- noi.ac day3t2 染色
传送门 分析 dp[i][j]为考虑前i个位置,[i-j+1,i]中的颜色互不相同,并且ai-j与这段区间中的某一个位置颜色相同 我们枚举第i+1个位置和[i-j+1,i]中的哪一个颜色相同或者全部不 ...
- loj10088 出纳员问题
传送门 分析 我们设pre[i]为到第i个时段的雇佣员工的总数量,sum[i]表示时段i的可雇佣员工的总数量,r[i]表示时段i所需工人的数量.由此我们不难求出: 0<=pre[i]-pre[i ...
- 100078D Domestic Networks
传送门 题目大意 有两种染料,给定它们的单价和数量,每染色一米需耗费一个单位的染料,一条边只能用一种燃料,给你一张图,要求你将其中的一些边染色使得在满足图联通的情况下花费最小并输出方案. 分析 首先, ...
- 自定义MVC的Helper扩展方法 转 Insus.NET
记得在开发ASP.NET时候,也经常性使用C#可以写自己义的扩展方法,如: http://www.cnblogs.com/insus/p/3154363.html 或http://www.cnblog ...
- C++新标准:列表初始化
一.列表初始化意义 C++新标准为vector提供了一种新的初始化方式:列表初始化.适用于知道多个成员具体值的情况. 二.列表初始化用法 /*1.空vector<int>*/ vector ...