Sum square difference
Problem 6
The sum of the squares of the first ten natural numbers is,
12 + 22 + ... + 102 = 385
The square of the sum of the first ten natural numbers is,
(1 + 2 + ....
分类:
其他好文 时间:
2014-05-23 02:22:57
阅读次数:
193
Smallest multiple
Problem 5
2520 is the smallest number that can be divided by each of the numbers from 1 to 10 without any remainder.
What is the smallest positive number that is evenly di...
分类:
其他好文 时间:
2014-05-23 01:51:13
阅读次数:
261
一笔画问题
时间限制:3000 ms | 内存限制:65535 KB
难度:4
描述
zyc从小就比较喜欢玩一些小游戏,其中就包括画一笔画,他想请你帮他写一个程序,判断一个图是否能够用一笔画下来。
规定,所有的边都只能画一次,不能重复画。
输入第一行只有一个正整数N(N
每组测试数据的第一行有两个正整数P,Q(P
随后的Q行,每行有...
分类:
其他好文 时间:
2014-05-22 22:41:12
阅读次数:
297
Problem 4: Largest palindrome product
A palindromic number reads the same both ways. The largest palindrome made from the product of two 2-digit numbers is 9009 = 91 × 99.
Find the largest pal...
分类:
其他好文 时间:
2014-05-22 18:48:46
阅读次数:
355
一、什么是中国邮递员问题?
在一个已知的地区,邮差要设法找到一条最短路径,可以走过此地区所有的街道,且最后要回到出发点。 中国邮递员问题由管梅谷教授在1962年提出。
我们会想到利用图来解决中国邮递员问题,其中就有种专门针对这种只访问一次路径的图的概念,称作欧拉图,由瑞士数学家Leonhard...
分类:
其他好文 时间:
2014-05-22 03:20:01
阅读次数:
554
http://acm.hdu.edu.cn/showproblem.php?pid=16951
/** 2 大意: ab 那么 6 对于1-b 之间的互质的数 就是欧拉函数, 7 对于b+1 -- d 从b+1 -- d 之间找一个数y, 在 1 - b
之间寻找与其互质的数。 那么...
分类:
其他好文 时间:
2014-05-14 01:31:08
阅读次数:
269
1 /** 2 大意: 求[a,b] 之间 phi(a) + phi(a+1)...+ phi(b);
3 思路: 快速求欧拉函数 4 **/ 5 6 #include 7 #include 8 using namespace std; 9 #define Max
300000010 11 ...
分类:
其他好文 时间:
2014-05-14 00:47:07
阅读次数:
287
1 /** 2 大意: 给定小数(p/q),求其循环节的大小和循环节开始的位置 3 解法:
若出现循环 ai*2^m= aj%p; 4 即 2^m %p =1 5 若2与p 互素,则可由欧拉函数的, 6 ...
分类:
其他好文 时间:
2014-05-13 20:39:25
阅读次数:
321
题意很简单,求sum(gcd(i,n)) 1
这题看到后第一反应并没有里用积性函数的性质,不过也可以做,欣慰的是我反应还是比较快的
设f(n)=gcd(1,n)+gcd(2,n)+....+gcd(n-1,n) + gcd(n,n),
用g(n,i)表示满足 gcd(x,n)=i的 x的个数 (x小于n),则 f(n)=sum{i*g(n,i)};
同时又利用 扩展欧几里德的性...
分类:
其他好文 时间:
2014-05-13 13:40:58
阅读次数:
365
基本概念及定理1. 欧拉通路、欧拉回路、欧拉图无向图:1)
设G是连通无向图,则称经过G的每条边一次并且仅一次的路径为欧拉通路;2) 如果欧拉通路是回路(起点和终点是同一个顶点),则称此回路为欧拉回路(Euler
circuit);3) 具有欧拉回路的无向图G称为欧拉图(Euler graph...
分类:
其他好文 时间:
2014-05-13 11:11:13
阅读次数:
363