zoj 2520 Amicable Pairs
来源:互联网 发布:apache添加虚拟主机 编辑:程序博客网 时间:2024/04/29 23:52
http://acm.zju.edu.cn/onlinejudge/showProblem.do?problemId=1520
好题,又学习了一种方法.
此题只要建一个表,里面放上它的所有因数就可以了.
新建一个因数表并打印1到500的每个数的因数:
将因数表中的每个数的每个因数相加(题目中说除了1和本身.所以上面的程序再删除几句代码就可以了),并放到一个数组sum里面
然后判断sum[sum[i]] == i 是否成立就可以了.
好了,贴上代码:
- zoj 2520 Amicable Pairs
- zoj 2520 Amicable Pairs
- ZOJ 2520 Amicable Pairs(打表)
- Amicable numbers
- No_21:Amicable numbers
- Amicable numbers -- Javascript 实现
- Euler: Amicable numbers
- PE 21 Amicable numbers
- pairs
- pairs
- (Problem 21)Amicable numbers
- 21 Amicable numbers - Project Euler
- project euler 21 Amicable numbers
- zoj 2520
- ZOJ-2520
- projecteuler---->problem=21----Amicable numbers
- Project Euler:Problem 21 Amicable numbers
- I00039 亲密数(Amicable numbers)
- 组图小游戏(vc)
- Cannot modify header information - headers already sent by错误解决办法
- 素数
- _variant_t ,_bstr_t 与 CString 类有什么区别
- 简单的高亮关键字的Javascript实现方式
- zoj 2520 Amicable Pairs
- 如何将FBReader引入MID
- linux内核阅读工具
- 正试图在 os 加载程序锁内执行托管代码。不要尝试在 DllMain 或映像初始化函数内运行托管代码,这样做会导致应用程序挂起
- Linux非常有用的设置
- Linux主机下配置Oracle 10G自动启动
- Data Services Stress Testing Framework
- HTML网页与FLASH之间的“静态”传值
- 使用Spring中的IoC功能来实现我们所开发项目系统的国际化