- 博客(3)
- 收藏
- 关注
原创 Happy 2006
Two positive integers are said to be relatively prime to each other if the Great Common Divisor (GCD) is 1. For instance, 1, 3, 5, 7, 9...are all relatively prime to 2006. Now your job is easy: for t...
2018-12-04 21:51:35 639 3
转载 放苹果
把M个同样的苹果放在N个同样的盘子里,允许有的盘子空着不放,问共有多少种不同的分法?(用K表示)5,1,1和1,5,1 是同一种分法。 Input 第一行是测试数据的数目t(0 <= t <= 20)。以下每行均包含二个整数M和N,以空格分开。1<=M,N<=10。 Output 对输入的每组数据M和N,用一行输出相应的K。 Sample Input 1 7 ...
2018-12-03 20:53:49 111
原创 GCD (HDU - 1695 容斥原理和欧拉函数)
Given 5 integers: a, b, c, d, k, you're to find x in a...b, y in c...d that GCD(x, y) = k. GCD(x, y) means the greatest common divisor of x and y. Since the number of choices may be very large, you're...
2018-12-03 16:05:25 626
空空如也
空空如也
TA创建的收藏夹 TA关注的收藏夹
TA关注的人