codeforces_630F.Selection of Personnel
来源:互联网 发布:超级奇门排盘软件 编辑:程序博客网 时间:2024/05/16 09:20
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.
Input
The only line of the input contains one integer n (7 ≤ n ≤ 777) — the number of potential employees that sent resumes.
Output
Output one integer — the number of different variants of group composition.
Examples
Input
Output
1
29
一样要考虑溢出问题
#include <iostream>#include <cstdio>#include <cstdlib>#include <cmath>using namespace std;long long solve(int n,int m){ int num=1; long long ans=1; while(m--) { ans*=(n-m); ans/=num; num++; } return ans;}int main(){ int n,i; scanf("%d",&n); long long ans=0; for(i=5;i<=7;i++) { ans+=solve(n,i); } printf("%lld\n",ans); return 0;}
0 0
- codeforces_630F.Selection of Personnel
- Selection of Personnel
- CODEFORCES630F-Selection of Personnel
- Codeforces 630F - Selection of Personnel
- codeforces 630F Selection of Personnel
- CodeForces-630 F. Selection of Personnel【排列组合】
- codeforces #630 F. Selection of Personnel
- CodeForces-630F.Selection of Personnel
- Codeforces 630F Selection of Personnel ( C(a,b) )
- CodeForces 630 F. Selection of Personnel(组合数学)
- CodeForces - 630F Selection of Personnel (组合数学)
- Codeforces--630F--Selection of Personnel(组合数)
- Codeforces 630F:Selection of Personnel【数列组合】
- Codeforces--630F--Selection of Personnel(组合数)
- codeforces 630F Selection of Personnel(组合数)
- CodeForces 630F-Selection of Personnel【组合数学】
- Codeforces 630F Selection of Personnel 【组合数】
- Vocational Traits of research personnel
- 频域互相关延迟估计
- Scala的sealed关键字
- 成员内部类(实例内部类)
- 【leetcode】Array—— Maximum Subarray(53)
- Servlet生成验证码并进行账号密码和验证码的验证登陆!
- codeforces_630F.Selection of Personnel
- zzuli蓝桥 text1 F 木块拼接
- MFC中关于基于对话框的应用程序的WM_COMMAND消息的流动路径
- KaliLinux装好系统后安装常用软件
- zzuli蓝桥 text1 G 搬砖
- HDOJ Elevator
- CentOS6.5 64位安装单机版hadoop2.6教程
- LeetCode : Palindrome Number [java]
- long的取值范围