数学--数论--HDU 2674 沙雕题】的更多相关文章

WhereIsHeroFrom: Zty, what are you doing ? Zty: I want to calculate N!.. WhereIsHeroFrom: So easy! How big N is ? Zty: 1 <=N <=1000000000000000000000000000000000000000000000- WhereIsHeroFrom: Oh! You must be crazy! Are you Fa Shao? Zty: No. I haven'…
Your job is simple, for each task, you should output Fn module 109+7. Input The first line has only one integer T, indicates the number of tasks. Then, for the next T lines, each line consists of 6 integers, A , B, C, D, P, n. 1≤T≤200≤A,B,C,D≤1091≤P,…
This time I need you to calculate the f(n) . (3<=n<=1000000) f(n)= Gcd(3)+Gcd(4)+-+Gcd(i)+-+Gcd(n). Gcd(n)=gcd(C[n][1],C[n][2],--,C[n][n-1]) C[n][k] means the number of way to choose k things from n some things. gcd(a,b) means the greatest common di…
I will show you the most popular board game in the Shanghai Ingress Resistance Team. It all started several months ago. We found out the home address of the enlightened agent Icount2three and decided to draw him out. Millions of missiles were detonat…
HazelFan is given two positive integers a,b, and he wants to calculate amodb. But now he forgets the value of b and only remember the value of a, please tell him the number of different possible results. Input The first line contains a positive integ…
RXD is a good mathematician. One day he wants to calculate: output the answer module 109+7. p1,p2,p3-pk are different prime numbers Input There are several test cases, please keep reading until EOF. There are exact 10000 cases. For each test case, th…
There are an equation. ∑0≤k1,k2,⋯km≤n∏1⩽j<m(kj+1kj)%1000000007=? We define that (kj+1kj)=kj+1!kj!(kj+1−kj)! . And (kj+1kj)=0 while kj+1<kj. You have to get the answer for each n and m that given to you. For example,if n=1,m=3, When k1=0,k2=0,k3=0,(k…
由0和1组成的串中,不能表示为由几个相同的较小的串连接成的串,称为本原串,有多少个长为n(n<=100000000)的本原串? 答案mod2008. 例如,100100不是本原串,因为他是由两个100组成,而1101是本原串. Input 输入包括多个数据,每个数据一行,包括一个整数n,代表串的长度. Output 对于每个测试数据,输出一行,代表有多少个符合要求本原串,答案mod2008. Sample Input 1 2 3 4 Sample Output 2 2 6 12 解析: 考虑所有…
Giving the N, can you tell me the answer of F(N)? Input Each test case contains a single integer N(1<=N<=10^9). The input is terminated by a set starting with N = 0. This set should not be processed. Output For each test case, output on a line the v…
Problem Description 七夕节那天,月老来到数字王国,他在城门上贴了一张告示,并且和数字王国的人们说:"你们想知道你们的另一半是谁吗?那就按照告示上的方法去找吧!" 人们纷纷来到告示前,都想知道谁才是自己的另一半.告示如下: 数字N的因子就是所有比N小又能被N整除的所有正整数,如12的因子有1,2,3,4,6. 你想知道你的另一半吗? Input 输入数据的第一行是一个数字T(1<=T<=500000),它表明测试数据的组数.然后是T组测试数据,每组测试数据…