E-COM-NET
首页
在线工具
Layui镜像站
SUI文档
联系我们
推荐频道
Java
PHP
C++
C
C#
Python
Ruby
go语言
Scala
Servlet
Vue
MySQL
NoSQL
Redis
CSS
Oracle
SQL Server
DB2
HBase
Http
HTML5
Spring
Ajax
Jquery
JavaScript
Json
XML
NodeJs
mybatis
Hibernate
算法
设计模式
shell
数据结构
大数据
JS
消息中间件
正则表达式
Tomcat
SQL
Nginx
Shiro
Maven
Linux
Euler
NYOJ 479 (数的互质)
参考:http://en.wikipedia.org/wiki/
Euler
%27s_totient_function View Code 1 #include<stdio.h>
·
2015-11-11 06:48
OJ
hrbeu 1347
Euler
欧拉值
#include<stdio.h>#include<string.h>#include<math.h>#define LL long long#define nmax 3000001int prime[nmax], phi[nmax];int plen;void init() { int i, j; memset(
·
2015-11-11 06:00
Euler
Project
Euler
最近发现了一个很有趣的网站,Project
Euler
上面全是数学题,不过大多需要用编程解决 Problem 3: 求:600851475143的最大素因子。
·
2015-11-11 05:28
project
欧拉回路基本概念及定理
欧拉通路、欧拉回路、欧拉图无向图:1) 设G是连通无向图,则称经过G的每条边一次并且仅一次的路径为欧拉通路;2) 如果欧拉通路是回路(起点和终点是同一个顶点),则称此回路为欧拉回路(
Euler
circuit
·
2015-11-11 04:47
project
euler
--10
Question: The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. Code: import math def IsPrime(n): if n==1: return False else
·
2015-11-11 01:32
project
平面几何中的有名定理 PPT
•Menelaus定理与Ceva定理•蝴蝶定理•9点圆*•Brianchon‘svs.Pascal’s对偶定理•
Euler
线*•一道初中数学竞赛题•…•直角三角形ABC,AD垂直BC于D,DC上任取一点
cteng
·
2015-11-10 22:00
数学
平面几何
【笔记】常微分方程(2)
欧拉法 % M函数
euler
.m function[t,y]=
euler
(odefun,tspan,y0,h) t=tspan(1):h:tspan(2); y(1)=y0; for i=1:length
·
2015-11-09 13:57
笔记
欧拉项目python代码(1--10)
欧拉计划(Project
Euler
)是一个解题网站,站内提供了一系列数学题供用户解答。 以下代码均为本人亲自编写,仅保证答案与欧拉项目的答案相同。至于代码质量,能力有限,只能尽力而为。
·
2015-11-09 13:32
python
[BZOJ]3737 [Pa2013]
Euler
从这个FB开始写博客啦。 也不知道会坚持多久…… = =似乎要加一句转载请注明出处 http://www.cnblogs.com/DancingOnTheTree/p/4026076.html http://www.lydsy.com/JudgeOnline/problem.php?id=3737 因为是好玩的数学题所以刚看见的时候就想捉了…
·
2015-11-08 17:10
Euler
欧拉函数
例如
euler
(8)=4,因为1,3,5,7均和8互质。
·
2015-11-08 16:26
函数
Hdu 2824 The
Euler
function
欧拉函数筛选法练习。 CODE: #include <stdio.h> #include <stdlib.h> #include < string.h> using namespace std; const int SIZE = 300000
·
2015-11-08 11:16
function
poj 2462 Period of an Infinite Binary Expansion
显然当分母不能整除2的时候,即分母和2互质的话,就可以利用欧拉定理,使得2^(
Euler
(b)) = 1(mod b)。然后对于
Euler
(b),枚举其因子,找到最小循环节就可
·
2015-11-08 10:04
binary
数论随笔(待补充)
Euler
函数表达通式:
euler
(x)=x(1-1/p1)(1-1/p2)(1-1/p3)(1-1/p4)…(1-1/pn),其中p1,p2……pn为x的所有素因数,x是不为0的整数。
euler
Christen
·
2015-11-07 22:00
欧拉函数
此函数以其首名研究者欧拉命名,它又称为
Euler
's totient function、φ函数、欧拉商数等。 例如φ(8)=4,因为1,3,5,7均和8互质。
·
2015-11-07 15:33
函数
Project
Euler
126 - Cuboid layers
这题先是推公式… 狂用不完全归纳+二次回归,最后推出这么一个奇怪的公式 \[f(t,x,y,z)=4(t-1)(x+y+z+t-2)+2(xy+yz+xz)\] 表示长宽高为\(x\)、\(y\)、\(z\)的立方体第\(t\)层放的立方体的个数。 接下来就是算答案了… 方法很简单:暴力 但是暴力还是有技巧的,开始我是直接从1到1000枚举\(t\)、\(x\)、\(y\)、\(z\)
·
2015-11-07 15:23
project
hdu 4676 Sum Of Gcd
思路:序列a[1],a[2],a[3]……a[n] num[i]表示区间[L,R]中是i的倍数的个数;
euler
[i]表示i的欧拉函数值。
·
2015-11-07 14:18
HDU
hdu 2824 The
Euler
function
快速求出欧拉函数值……注意数据类型,否则会超时的 #include<iostream>using namespace std;const long MMAX=3000000;__int64
Euler
·
2015-11-07 14:32
function
hdu 4556 Stern-Brocot Tree
刚开始不知道怎么做,看了大神的做法后,才知道要用到欧拉函数…… #include<iostream>using namespace std;const int N=1000010;__int64
euler
·
2015-11-07 14:30
tree
poj3696
欧拉定理,对于正整数a,n,若gcd(a,n)=1,则有a^
euler
(n)=1(mod n)。
·
2015-11-07 12:39
poj
Project
Euler
problem 61
题意很明了。 然后我大概的做法就是暴搜了 先把每个几边形数中四位数的处理出来。 然后我就DFS回溯着找就行了。 比较简单吧。 #include <cstdio> #include <iostream> #include <algorithm> #include <cstring> #include <
·
2015-11-07 12:24
project
POJ 1637 Sightseeing tour
1 定义 欧拉通路 (
Euler
tour)——通过图中每条边一次且仅一次,并且过每一顶点的通路。欧拉回路 (
Euler
circuit)——通过图中每条边一次且仅一次,并且过每一顶点的回路。
·
2015-11-07 11:44
poj
一些简单的编程练习题
Project
Euler
和类似的问题通常对初学者来说来难了,尤其是对于那些没有很强数学背景的同学。
·
2015-11-07 11:56
编程
(Problem 70)Totient permutation
Euler
's Totient function, φ(n) [sometimes called the phi function], is used to determine the number of
·
2015-11-07 10:45
IE
欧拉-拉格朗日方程
欧拉-拉格朗日方程 欧拉-拉格朗日方程 (
Euler
-Lagrange equation) 为变分法中的一条重要方程。它提供了求泛函的平稳值的一个方法。
·
2015-11-03 21:33
hdu4992 Primitive Roots(所有原根)
int
Euler
(int n) { int i,ans=n; for(i=2;i*i<=
·
2015-11-02 19:41
root
HDU 2824 The
Euler
function
该题刚开始用最原始的方法,先筛出质数,再利用X=( p1-1 )*( p2-1 )*....*( pn-1 )*( p1^( q1-1 ) )*( p2^( q2-1 ) )*...*( pn^( qn-1 ) ),我就测试了一下3--3000000发现要好长的时间我就知道这种方法一定会超时;后来看
·
2015-11-02 18:17
function
【欧拉函数】
此函数以其首名研究者欧拉命名,它又称为
Euler
's totient function、φ函数、欧拉商数等。 例如φ(8)=4,因为1,3,5,7均和8互质。
·
2015-11-02 17:19
函数
LA 3263 (平面图的欧拉定理) That Nice
Euler
Circuit
题意: 平面上有n个端点的一笔画,最后一个端点与第一个端点重合,即所给图案是闭合曲线。求这些线段将平面分成多少部分。 分析: 平面图中欧拉定理:设平面的顶点数、边数和面数分别为V、E和F。则 V+F-E=2 所求结果不容易直接求出,因此我们可以转换成 F=E-V+2 枚举两条边,如果有交点则顶点数+1,并将交点记录下来 所有交点去重(去重前记得排序),如果某个交点在线段上,则边数+1
·
2015-11-02 15:04
Euler
poj2478
欧拉函数,n每扩大一个,就会有
euler
(n)个数字加入到集合中,所以欧拉函数的前n项和即为所求。
·
2015-11-02 14:23
poj
poj2407
题意:给出n,求欧拉函数,欧拉函数
euler
(n)表示小于等于n的与n互质的数的个数,在欧拉函数,认为如果两数最大公约数为1,则两数互质。所以,n与1也互质,且
euler
(1)=1。
·
2015-11-02 14:20
poj
[Project
Euler
]加入欧拉 Problem 17
If the numbers 1 to 5 are written out in words: one, two, three, four, five, then there are 3 + 3 + 5 + 4 + 4 = 19 letters used in total. If all the numbers from 1 to 1000 (one thousand) inclu
·
2015-11-02 09:46
project
[Project
Euler
]加入欧拉 Problem 16
215 = 32768 and the sum of its digits is 3 + 2 + 7 + 6 + 8 = 26. What is the sum of the digits of the number 21000? 计算 2 的 1000次方的所有数字的和? 这个设计大数乘方问题,我自己写了一个计算大数乘方的函数来计算。 先来说下如何计算大数乘方的问题吧,通用的思路就是
·
2015-11-02 09:45
project
[Project
Euler
]加入欧拉 Problem 15
Starting in the top left corner of a 22 grid, there are 6 routes (without backtracking) to the bottom right corner. How many routes are there through a 2020 grid? 从 2*2的一个角到达另外一个对角有6条线
·
2015-11-02 09:44
project
[Project
Euler
]加入欧拉 Problem 14
The following iterative sequence is defined for the set of positive integers: n n/2 (n is even)n 3n + 1 (n is odd) Using the rule above and starting with 13, we generate the following sequence:
·
2015-11-02 09:43
project
[Project
Euler
]欧拉 Problem 13 回答上次的问题
在前面的一篇文章里,文章链接地址: http://http://www.cnblogs.com/herbert/archive/2011/01/31/1948181.html 我写了下面这段代码来解决Problem 13。结果一直没有得出答案,今天过完节了,回来看了下,呵呵终于找出问题所在了。 欧拉项目第十三题原解答#include <stdio.h> #include &
·
2015-11-02 09:43
project
[Project
Euler
]加入欧拉 Problem 13 被卡住了,调试不出正确结果囧
Work out the first ten digits of the sum of the following one-hundred 50-digit numbers. 37107287533902102798797998220837590246510135740250463769376774900097126481248969700780504170182605387432498619
·
2015-11-02 09:42
project
[Project
Euler
]加入欧拉 Problem 12
The sequence of triangle numbers is generated by adding the natural numbers. So the 7^(th) triangle number would be 1 + 2 + 3 + 4 + 5 + 6 + 7 = 28. The first ten terms would be: 1, 3, 6, 10, 15, 21,
·
2015-11-02 09:41
project
[Project
Euler
]加入欧拉 Problem 11
In the 20×20 grid below, four numbers along a diagonal line have been marked in red. 08 02 22 97 38 15 00 40 00 75 04 05 07 78 52 12 50 77 91 0849 49 99 40 17 81 18 57 60 87 17 40 98 43 69 48
·
2015-11-02 09:40
project
[Project
Euler
]加入欧拉 Problem 9
A Pythagorean triplet is a set of three natural numbers, a b c, for which, a2 + b2 = c2 For example, 32 + 42 = 9 + 16 = 25 = 52. There exists exactly one Pythagorean triplet for which a + b +
·
2015-11-02 09:39
project
[Project
Euler
]加入欧拉 Problem 10
The sum of the primes below 10 is 2 + 3 + 5 + 7 = 17. Find the sum of all the primes below two million. 找出小于2,000,000里面的质数然后求和。 不用什么好办法,2000000,这个数不算太大,直接求解。 在能节省空间和时间的地方尽量节省。比如可以使用unsi
·
2015-11-02 09:39
project
[Project
Euler
]加入欧拉 Problem 8
Find the greatest product of five consecutive digits in the 1000-digit number. 73167176531330624919225119674426574742355349194934969835203127745063262395783180169848018694788518438586156078911294949
·
2015-11-02 09:38
project
[Project
Euler
]加入欧拉 Problem 7
By listing the first six prime numbers: 2, 3, 5, 7, 11, and 13, we can see that the 6^(th) prime is 13. What is the 10001^(st) prime number? 求第10001个质数。 这个比较简单,使用一个循环就出来了,不到2秒。 欧拉项目第七题#i
·
2015-11-02 09:37
project
[Project
Euler
]加入欧拉 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 + ... + 10)2 = 552 = 3025 Hence the diff
·
2015-11-02 09:36
project
[Project
Euler
]加入欧拉 Problem3
The prime factors of 13195 are 5, 7, 13 and 29. What is the largest prime factor of the number 600851475143 ? 找出600851475143的最大质因数。下面是我的程序: Find the largest prime factor#include <stdi
·
2015-11-02 09:36
project
pku 2284 That Nice
Euler
Circuit
题意: 给你n个点第n个点保证与第0个点相交,然后求这n个点组成的图形可以把整个平面分成几个面 思路: 这里的解题关键是知道关于多面体的欧拉定理 多面体: 设v为顶点数,e为棱数,f是面数,则v-e+f=2-2pp为欧拉示性数,例如p=0 的多面体叫第零类多面体p=1 的多面体叫第一类多面体 这里满足的是零类多面体,我们只要求出该图形的 点v,边e即可。 怎么求点v呢
·
2015-11-01 14:06
Euler
UVa 10735 (混合图的欧拉回路)
Euler
Circuit
题意: 给出一个图,有的边是有向边,有的是无向边。试找出一条欧拉回路。 分析: 按照往常的思维,遇到混合图,我们一般会把无向边拆成两条方向相反的有向边。 但是在这里却行不通了,因为拆成两条有向边的话,就表示这个边能“在两个相反方向各经过一次”。 而题意是这个边只能经过一次。 假设图中存在欧拉回路,则所有点的出度out(i) 等于 入度in(i) 不妨这样,先将所有的无
·
2015-11-01 14:19
Euler
hdu 2824 The
Euler
function
欧拉函数~~ 第一次写欧拉函数,以前只知道其定义,以为编码按其过程一步一步的实现应该就可以,结果发现不太一样。 超时的想法:首先筛选素数,刚开始是筛选了N以内的所有素数,然后对于每个数,从小到大枚举素数, for(;;)//枚举素数 if(n%prime[i]==0) { phj[n]=phj[n]-phj[n]/prime[i];
·
2015-11-01 14:03
function
[Project
Euler
] Problem 21
Let d(n) be defined as the sum of proper divisors of n (numbers less than n which divide evenly into n). If d(a) = b and d(b) = a, where a b, then a and b are an amicable pair and each of a and b are
·
2015-11-01 13:37
project
[Project
Euler
] Problem 19
You are given the following information, but you may prefer to do some research for yourself. 1 Jan 1900 was a Monday. Thirty days has September, April, June and November. All the rest have thir
·
2015-11-01 13:36
project
[Project
Euler
] Problem 20
n! means n (n 1) ... 3 2 1 Find the sum of the digits in the number 100! 这道题的做法和那个求2的1000次方的各位和的思路一样 我们只需要在那道题程序的基础上稍加改变就可以了 #include < iostream > using namespace std; int main
·
2015-11-01 13:36
project
上一页
10
11
12
13
14
15
16
17
下一页
按字母分类:
A
B
C
D
E
F
G
H
I
J
K
L
M
N
O
P
Q
R
S
T
U
V
W
X
Y
Z
其他