/* * POJ_2249.cpp * * Created on: 2013年10月8日 * Author: Administrator */ #include <iostream> #include <cstdio> using namespace std; typedef long long int64; int64 work(int64 n , int64 k){ if(k > n/2){ k = n-k; } int64 a = 1; int64 b = 1; int…
// n 个 数 取 k个数的取法// C(n,k) 注意些细节#include <iostream> #include <string> #include<sstream> #include <cmath> #include <map> #include <stdio.h> #include <string.h> #include <algorithm> using namespace std; #defin…
Binomial Showdown Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 18457   Accepted: 5633 Description In how many ways can you choose k elements out of n elements, not taking order into account?  Write a program to compute this number. In…
/** 大意: 给定16进制数的16个字母,,求第k大的数,,要求数的长度最大为8.,并且每个数互不相同. 思路: 从高到低挨个枚举,每一位能组成的排列数 ,拿最高位来说,能做成的排列数为15*A(15,len-i) 第二位 A(14,len-2)..这样就可以找到k大的数的长度 接下来 .找第k大的数.同上理 ,挨个枚举每一位即可..若加上该位的排列数大于k,则该位就是这个数,继续枚举下一位 **/ /** 大神思路 首先确定数字串的长度Len:从大到小枚举Len,每个Len下有15*P(15…
#include<cstdio> #include<cstring> #define ll long long #define mod 20100713 ; ll a[maxn]; ll poww(ll x,int n) { ll ret=; while(n) { ) ret=ret*x%mod; n>>=; x=x*x%mod; } return ret; } int main() { a[]=; ;i<maxn;i++) a[i]=a[i-]*i%mod; i…
水题三题: 1.给你B和N,求个整数A使得A^n最接近B 2. 输出第N个能被3或者5整除的数 3.给你整数n和k,让你求组合数c(n,k) 1.poj 3100 (zoj 2818) Root of the Problem: http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemCode=2818 http://poj.org/problem?id=3100 #include<cstdio> #include<cmath>…
Binomial Showdown Time Limit: 1000MS   Memory Limit: 65536K Total Submissions: 22692   Accepted: 6925 Description In how many ways can you choose k elements out of n elements, not taking order into account? Write a program to compute this number. Inp…
Binomial Showdown TimeLimit: 1 Second   MemoryLimit: 32 Megabyte Totalsubmit: 2323   Accepted: 572 Description In how many ways can you choose k elements out of n elements, not taking order into account? Write a program to compute this number. Input…
Binomial Showdown Time Limit: 2 Seconds      Memory Limit: 65536 KB In how many ways can you choose k elements out of n elements, not taking order into account? Write a program to compute this number. Input The input will contain one or more test cas…
CARDS Time Limit: 1000MS   Memory Limit: 10000K Total Submissions: 1448   Accepted: 773 Description Alice and Bob have a set of N cards labelled with numbers 1 ... N (so that no two cards have the same label) and a shuffle machine. We assume that N i…