POJ 2519
又是一个水题?? 不过还是弄是很久... 在蒟蒻的路上越走越远 , 好了讲题
新生晚会
Time Limit: 2000/1000 MS (Java/Others) Memory Limit: 32768/32768 K (Java/Others)
Total Submission(s): 13433 Accepted Submission(s): 4641
每组数据包含两个整数N(来报名的人数,1<=N<=30),M(节目需要的人数0<=M<=30)
3 2
5 3
4 4
3 6
8 0
10
1
0
1
#include<iostream>
#include<algorithm>
using namespace std; long long g(int n, int m){
if(n < m) return ;
else if(m == || n == m) return ;
else{
m = max(m, n-m);
long long ans = ;
for(int i=; i<=m; i++) ans = ans*(n-i+)/i;
return ans;
}
} int main(){
int T;
cin >> T;
while(T--){
int m, n;
cin >> m >> n;
cout << g(m, n) << endl;
} return ;
}
POJ 2519的更多相关文章
- POJ 3370. Halloween treats 抽屉原理 / 鸽巢原理
Halloween treats Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 7644 Accepted: 2798 ...
- POJ 2356. Find a multiple 抽屉原理 / 鸽巢原理
Find a multiple Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 7192 Accepted: 3138 ...
- POJ 2965. The Pilots Brothers' refrigerator 枚举or爆搜or分治
The Pilots Brothers' refrigerator Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 22286 ...
- POJ 1753. Flip Game 枚举or爆搜+位压缩,或者高斯消元法
Flip Game Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 37427 Accepted: 16288 Descr ...
- POJ 3254. Corn Fields 状态压缩DP (入门级)
Corn Fields Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 9806 Accepted: 5185 Descr ...
- POJ 2739. Sum of Consecutive Prime Numbers
Sum of Consecutive Prime Numbers Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 20050 ...
- POJ 2255. Tree Recovery
Tree Recovery Time Limit: 1000MS Memory Limit: 65536K Total Submissions: 11939 Accepted: 7493 De ...
- POJ 2752 Seek the Name, Seek the Fame [kmp]
Seek the Name, Seek the Fame Time Limit: 2000MS Memory Limit: 65536K Total Submissions: 17898 Ac ...
- poj 2352 Stars 数星星 详解
题目: poj 2352 Stars 数星星 题意:已知n个星星的坐标.每个星星都有一个等级,数值等于坐标系内纵坐标和横坐标皆不大于它的星星的个数.星星的坐标按照纵坐标从小到大的顺序给出,纵坐标相同时 ...
随机推荐
- extern
gcc编译器编译程序有四个阶段,预处理.编译.汇编.链接.预处理阶段会将源代码中的包含的头文件如stdio.h编译进来:编译阶段,gcc首先要检查代码的规范性.是否有语法错误等,以确定代码的实际要做的 ...
- Latex中插入C语言代码
Latex是一个文本排版的语言,能排版出各种我们想要的效果.而且用代码排版的优点是易于修改板式,因此在文本内容的排版时,Latex应用十分广泛. 当我们需要在Latex中插入代码时,就需要用到 \us ...
- js加密参数传给后台,后台解密base64
前台js // base64加密开始 var keyStr = "ABCDEFGHIJKLMNOP" + "QRSTUVWXYZabcdef" + " ...
- WINFORM时间控件(DATATIMEPICKER)的显示格式设置
将DateTimePicker控件拖出来后打开属性,找到Format属性,选择Costum选项: 然后找到CustomFormat属性,按照你要显示的格式来输入,示例如下: 若系统时间为:2016年1 ...
- cnetos7.0 安装mysql
CentOS 7的yum源中貌似没有正常安装mysql时的mysql-sever文件,需要去官网上下载 [root@localhost ~]# wget http://dev.mysql.com/ge ...
- PHP Math 函数
abs() 绝对值. 3 acos() 反余弦. 3 acosh() 反双曲余弦. 4 asin() 反正弦. 3 asinh() 反双曲正弦. 4 atan() 反正切. 3 atan2() 两个参 ...
- C#远程时间同步助手软件设计
C#远程时间同步助手软件设计 本程序才C#语言开发,实现远程时间同步功能,可以将本地时间每隔一段时间与时间服务器时间进行同步!不足之处还望见谅! 软件开发环境:Visual Studio 2010 软 ...
- react-native 踩坑记
最近在使用react-native的时候遇到了很多坑,这里给大家分享下 一.样式 react-native 虽然支持flex布局,但是所有的样式均是css样式的一个很小的集合,尤其是在安卓机下问题尤为 ...
- 查看文本[Linux]
查看文本 不分屏查看 cat (默认标准输入到标准输出) -n(行号) 连接...并显示 -E(每行行尾打印$) 翻屏:shift+pageUp/pageDown tac reverse cat 分屏 ...
- WorkFlowHelper
/* # Microshaoft /r:System.Xaml.dll /r:System.Activities.dll /r:System.Activities.DurableInstancing. ...