hdu 1164 Eddy's research I】的更多相关文章

Eddy's research I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5793    Accepted Submission(s): 3459 Problem Description Eddy's interest is very extensive, recently he is interested in prime n…
http://acm.hdu.edu.cn/showproblem.php?pid=1164 题意很简单,只是写代码的时候需要注意几个问题 一.筛选素数的时候记得用埃式筛选法,要是直接找可能会WA. int prime(int n) { int flag = 0; for(int i=2;i<=sqrt(n);i++) { if(n%i==0){ flag = 1;break; } } if(flag==1) return 0; else return 1; } void solve() { f…
题目链接 题意 : 给你一个数,让你用它的素数质因子表示出来. 思路 : 先打一下表,因为会有重复的质因子,所以从大到小开始找,并且找到一个之后不能就接着往下找,要再找一遍这个数. #include <stdio.h> #include <string.h> #include <math.h> #include <iostream> using namespace std ; ] ; void sett() { int i,j; ; i <= ; ++…
链接:传送门 题意:给出一个整数 n ,输出整数 n 的分解成若干个素因子的方案 思路:经典的整数分解题目,这里采用试除法 和 用筛法改造后的试除法 对正整数 n 进行分解 方法一:试除法对正整数 n 进行分解 /************************************************************************* > File Name: hdu1164.cpp > Author: WArobot > Blog: http://www.cnb…
思路:将输入的这个数分成n个素数的相乘的结果,用一个数组存储起来.之后再输出就能够了 Eddy's research I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6633    Accepted Submission(s): 3971 Problem Description Eddy's interest is very ext…
- Eddy's research II Time Limit:2000MS     Memory Limit:32768KB     64bit IO Format:%I64d & %I64u Submit Status Description As is known, Ackermann function plays an important role in the sphere of theoretical computer science. However, in the other h…
Problem Description Eddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't write program, so Eddy has to ask intelligent you to h…
Problem Description Eddy's interest is very extensive, recently he is interested in prime number. Eddy discover the all number owned can be divided into the multiply of prime number, but he can't write program, so Eddy has to ask intelligent you to h…
题意:给定一个表达式,然后让你求表达式的值. 析:多写几个就会发现规律. 代码如下: #pragma comment(linker, "/STACK:1024000000,1024000000") #include <cstdio> #include <string> #include <cstdlib> #include <cmath> #include <iostream> #include <cstring>…
题意:已知,求A(m, n). 分析:根据样例模拟一下过程就可以找出递推关系. #include<cstdio> #include<cstring> #include<cstdlib> #include<cctype> #include<cmath> #include<iostream> #include<sstream> #include<iterator> #include<algorithm>…
上一篇已经讲了,但是转载别人的很乱,这里自己根据blog里面写的思路,重新写过了一个程序 #include <iostream> #include <malloc.h> #include <math.h> #define N 65535 int primes[N]; int SimpleDivsion()//生成1-65535之间所有的质数 { ; int i,j; //int *primes = (int *)malloc(sizeof(int)*n); primes…
Eddy's research I Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 7389    Accepted Submission(s): 4472 Problem Description Eddy's interest is very extensive, recently he is interested in prime n…
// Eddy 继续 Problem Description As is known, Ackermann function plays an important role in the sphere of theoretical computer science. However, in the other hand, the dramatic fast increasing pace of the function caused the value of Ackermann function…
Eddy's picture 题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1162 ——每天在线,欢迎留言谈论. 题目大意: 给你N个点,求把这N个点连在一起的最短总距离. 思路: 假设每两两点之间都有路径,求最小生成树. AC代码:(Java) import java.util.Scanner; import java.math.*; public class Main { public static final int MAXN = 110;…
题目连接:http://acm.hdu.edu.cn/showproblem.php?pid=1162 Eddy's picture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 10085    Accepted Submission(s): 5094 Problem Description Eddy begins to like p…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=1162 Eddy's picture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 6866    Accepted Submission(s): 3469 Problem Description Eddy begins to like p…
传送门: http://acm.hdu.edu.cn/showproblem.php?pid=1210 Eddy's 洗牌问题 Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5279    Accepted Submission(s): 3479 Problem Description Eddy是个ACMer,他不仅喜欢做ACM题,而且…
麻痹,感冒了. ------------------------------------------------感冒了的分割线------------------------------------------------ HDU 1210 也就是 FOJ 1062 http://acm.hdu.edu.cn/showproblem.php?pid=1210 http://acm.fzu.edu.cn/problem.php?pid=1062 Eddy是个ACMer,他不仅喜欢做ACM题,而且对…
题目链接:http://acm.hdu.edu.cn/showproblem.php?pid=2204 解题报告:输入一个n让你求出[1,n]范围内有多少个数可以表示成形如m^k的样子. 不详细说了,自己一开始也忽略了三个素数的乘积的乘方的情况. #include<cstdio> #include<cstring> #include<iostream> #include<algorithm> #include<cmath> using names…
HDU 1163 题意简单,求n^n的(1)各数位的和,一旦和大于9,和再重复步骤(1),直到和小于10. //方法一:就是求模9的余数嘛! (228) leizh007 2012-03-26 21:03:19 (确实可行) #include<stdio.h> #include<string.h> int main() { int n,i,ans; while(scanf("%d",&n),n) { ans=; ;i<n;i++) { ans=(a…
Eddy's digital Roots Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 5783    Accepted Submission(s): 3180 Problem Description The digital root of a positive integer is found by summing the digit…
坐标之间的距离的方法,prim算法模板. Eddy's picture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others) Total Submission(s): 5620    Accepted Submission(s): 2821 Problem Description Eddy begins to like painting pictures recently ,he i…
Problem Description Eddy usually writes articles ,but he likes mixing the English letter uses, for example "computer science" is written frequently "coMpUtEr scIeNce" by him, this mistakes lets Eddy's English teacher be extremely disco…
Problem Description Eddy是个ACMer,他不仅喜欢做ACM题,而且对于纸牌也有一定的研究,他在无聊时研究发现,如果他有2N张牌,编号为1,2,3..n,n+1,..2n.这也是最初的牌的顺序.通过一次洗牌可以把牌的序列变为n+1,1,n+2,2,n+3,3,n+4,4..2n,n.那么可以证明,对于任意自然数N,都可以在经过M次洗牌后第一次重新得到初始的顺序.编程对于小于100000的自然数N,求出M的值.   Input 每行一个整数N   Output 输出与之对应的…
<题目链接> 题目大意: Ignatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣. 这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1. 正当他再度沉迷的时候,他发现不知道什么时候才能知道这样的数字的数量,因此他又求助于你这位聪明的程序员,请你帮他用程序解决这个问题. 为了简化,问题是这样的:给你一个正整数N,确定在1到N之间有多少个可以表示成M^K(K>1)的数. 解题分析…
题目链接 Problem Description Eddy begins to like painting pictures recently ,he is sure of himself to become a painter.Every day Eddy draws pictures in his small room, and he usually puts out his newest pictures to let his friends appreciate. but the res…
http://acm.hdu.edu.cn/showproblem.php?pid=1163 九余数定理: 如果一个数的各个数位上的数字之和能被9整除,那么这个数能被9整除:如果一个数各个数位上的数字之和被9除余数是几,那么这个数被9除的余数也一定是几. 证明: 首先10^i =99...9(i个9) +1除以9的余数=1 所以ai*10^i除以9的余数=ai 用a0~an表示各位数字则数=(anan-1an-2.a2a1a0), =an*10^n+an-1*10^n-1 +an-2 *10^n…
Eddy's爱好 Time Limit: 3000/1000 MS (Java/Others)    Memory Limit: 32768/32768 K (Java/Others) Problem Description Ignatius 喜欢收集蝴蝶标本和邮票,但是Eddy的爱好很特别,他对数字比较感兴趣,他曾经一度沉迷于素数,而现在他对于一些新的特殊数比较有兴趣.这些特殊数是这样的:这些数都能表示成M^K,M和K是正整数且K>1.正当他再度沉迷的时候,他发现不知道什么时候才能知道这样的数…
Eddy's picture Time Limit: 2000/1000 MS (Java/Others)    Memory Limit: 65536/32768 K (Java/Others)Total Submission(s): 6339    Accepted Submission(s): 3179 Problem Description Eddy begins to like painting pictures recently ,he is sure of himself to b…
题目:http://acm.hdu.edu.cn/showproblem.php?pid=1165 果断不擅长找规律啊,做这种题静不下心来. Ackermann function can be defined recursively as follows: 递推如上图, 0<m<=3,0<=n<=1000000,,当m==3时,n>=0&&n<=24. 首先发现a(0,i)=i+1; 另外n==0时,a(1,0)=a(0,1)=2; 当m==1,n>…