FZU 1876 JinYueTuan(排列组合)
Description
 
Now, do you know what it’s? Yeah , O(∩_∩)O~ , It is the game called JinYueTuan. chjing plays it very often years ago. I promise you would like it too. Now I want to introduce it to you. Maybe you have already known it clearly. Just be patient.
JinYueTuan is a famous online game which has been in vogue for a long time. Since it is so exciting a game that a large number of players put themselves in it . Only seven keys on the keyboard will be used in games, each key are assigned to one of the seven sound tracks. During the game, a series of notes may fall in each sound track irregularly. When notes fall down in one sound track, player should press the assigned key at once. If so, then got a “Cool”, or get “Miss” otherwise. You should press the key when the note is almost disappeared at the bottom of the window. If you press the key too early, you will miss the note. There will be a song or some kind of music played when you are playing the game. So you will feel you are a pianist. As you pass a low level .the notes will be more and the speed the notes fall will be very high. And the game will be more exciting .There are a lot of cows who play this game very well. If you have a chance to watch them playing, you would say ‘orz’ from your heart. But as a programmer, we would admire people who write this game more. Here comes the problem.
If you are assigned write a game similar to this game. If there are n different sound tracks and m different notes. How many different ways can you arrange the notes to fall.
Input
Output
Sample Input
Sample Output
Hint

We only care about the figure when the notes are piled up. So please ignore the sequence of the notes falling in different sound tracks.
#include <iostream>
#include <cstdio>
#include <cstring>
#include <string>
#include <cmath>
#include <vector>
#include <queue>
#include <map>
#include <set>
#include <stack>
#include <algorithm>
#define root 1,n,1
#define lson l,mid,rt<<1
#define rson mid+1,r,rt<<1|1
#define lr rt<<1
#define rr rt<<1|1
using namespace std; typedef long long LL;
const int inf = 1e9+;
const double PI = acos(-1.0);
const double eps = 1e- ;
const int N = ;
LL n , m , p ;
int main()
{
#ifdef LOCAL
freopen("in.txt","r",stdin);
#endif // LOCAL
ios::sync_with_stdio(false);
while( cin >> n >> m >> p ) {
LL res = ;
for( int i = n + m - ; i >= n ; --i ) {
res *= i ; res %= p ;
if( !res ) break ;
}
cout << res << endl;
}
}
FZU 1876 JinYueTuan(排列组合)的更多相关文章
- FOJ (FZU) 1476 矩形的个数 排列组合。
		http://acm.fzu.edu.cn/problem.php?pid=1476 Problem Description 在一个3*2的矩形中,可以找到6个1*1的矩形,4个2*1的矩形3个1* ... 
- 学习sql中的排列组合,在园子里搜着看于是。。。
		学习sql中的排列组合,在园子里搜着看,看到篇文章,于是自己(新手)用了最最原始的sql去写出来: --需求----B, C, F, M and S住在一座房子的不同楼层.--B 不住顶层.C 不住底 ... 
- .NET平台开源项目速览(11)KwCombinatorics排列组合使用案例(1)
		今年上半年,我在KwCombinatorics系列文章中,重点介绍了KwCombinatorics组件的使用情况,其实这个组件我5年前就开始用了,非常方便,麻雀虽小五脏俱全.所以一直非常喜欢,才写了几 ... 
- 【原创】开源.NET排列组合组件KwCombinatorics使用(三)——笛卡尔积组合
		本博客所有文章分类的总目录:本博客博文总目录-实时更新 本博客其他.NET开源项目文章目录:[目录]本博客其他.NET开源项目文章目录 KwCombinatorics组件文章目录: 1. ... 
- 【原创】开源.NET排列组合组件KwCombinatorics使用(二)——排列生成
		本博客所有文章分类的总目录:本博客博文总目录-实时更新 本博客其他.NET开源项目文章目录:[目录]本博客其他.NET开源项目文章目录 KwCombinatorics组件文章目录: 1. ... 
- 【原创】开源.NET排列组合组件KwCombinatorics使用(一)—组合生成
		本博客所有文章分类的总目录:本博客博文总目录-实时更新 本博客其他.NET开源项目文章目录:[目录]本博客其他.NET开源项目文章目录 KwCombinatorics组件文章目录: 1. ... 
- hdu1521 排列组合(指数型母函数)
		题意: 有n种物品,并且知道每种物品的数量ki.要求从中选出m件物品的排数. (全题文末) 知识点: 普通母函数 指数型母函数:(用来求解多重集的排列问题) n个元素,其中a1,a2, ... 
- [leetcode] 题型整理之排列组合
		一般用dfs来做 最简单的一种: 17. Letter Combinations of a Phone Number Given a digit string, return all possible ... 
- 排列组合算法(PHP)
		用php实现的排列组合算法.使用递归算法,效率低,胜在简单易懂.可对付元素不多的情况. //从$input数组中取$m个数的组合算法 function comb($input, $m) { if($m ... 
随机推荐
- 4.ireport基本使用
			转自:https://wenku.baidu.com/view/104156f9770bf78a65295462.html 第一部分,下载与安装 Ireport官网:http:// jasperfor ... 
- 微信小程序(13)--页面滚动到某个位置添加类效果
			微信小程序页面滚动到某个位置添加类,盒子置顶效果. <!-- vh,是指CSS中相对长度单位,表示相对视口高度(Viewport Height),1vh = % * 视口高度 --> &l ... 
- ltp-ddt realtime_cpuload_10p 涉及的cpuloadgen交叉编译及安装
			1.下载源码 https://github.com/ptitiano/cpuloadgen/archive/v0.94.tar.gz 解压 tar -zxvf cpuloadgen-0.94.tar. ... 
- vmwre虚拟机配置
			mware为我们提供了三种网络工作模式,它们分别是:Bridged(桥接模式).NAT(网络地址转换模式).Host-Only(仅主机模式).打开vmware虚拟机,我们可以在选项栏的“编辑”下的“虚 ... 
- 【抓包工具之Fiddler】导出jmeter脚本
			一.下载完成后,解压压缩包,将插件中的2个文件放入到Fiddler安装目录中 插件目录 二.打开fiddler,设置测试时过滤的条件(抓包可以指定域名的请求) 设置过滤条件 三.这里我 ... 
- center os7 安装mysql
			安装mariadb MariaDB数据库管理系统是MySQL的一个分支,主要由开源社区在维护,采用GPL授权许可.开发这个分支的原因之一是:甲骨文公司收购了MySQL后,有将MySQL闭源的潜在风险, ... 
- postcss-px-to-viewport 的 exclude 配置无效
			原来是由于版本太低的缘故: postcss-px-to-viewport 0.0.3版本不支持 exclude属性. 更新到 1.1.0 配置: // 路径中包含 PC ,则忽略 px转换为vw,vh ... 
- 设置intellij IDEA编辑框背景色
			首先是打开idea开发工具,然后点击左上角的File,选择Settings设置 应用即时生效,无需重启idea 
- 前端每日实战:47# 视频演示如何用纯 CSS 创作一个蝴蝶标本展示框
			效果预览 按下右侧的"点击预览"按钮可以在当前页面预览,点击链接可以全屏预览. https://codepen.io/comehope/pen/xzgZzQ 可交互视频教程 此视频 ... 
- JS在页面加载之后运行
			通用的页面加载后再运行JS有两种方式:1.在DOM加载完毕后,页面全部内容(如图片等)完全加载完毕前运行JS. 2.在页面全部内容加载完成(包括引用文件,图片等)之后再加载JS 1.在DOM加载后 ... 
