zoj 2095 Divisor Summation】的更多相关文章

和 hdu 1215 一个意思// 只是我 1坑了 1 时应该为0 #include <iostream> #include <math.h> #include <map> #include <stack> #include <queue> #include <vector> #include <algorithm> #include <stdio.h> #include <string.h> us…
DIVSUM - Divisor Summation #number-theory Given a natural number n (1 <= n <= 500000), please output the summation of all its proper divisors. Definition: A proper divisor of a natural number is the divisor that is strictly less than the number. e.g…
本题有两个难点: 1 大量的数据输入.没处理好就超时 - 这里使用buffer解决 2 因子分解的算法 a)暴力法超时 b)使用sieve(筛子),只是当中的算法逻辑也挺不easy搞对的. 数值N因子分解逻辑: 1 保存全部能够sqrt(N)范围内的质素 2 找到能够被N除尽的质素d, 然后用d去除N.使用deg变量,保存度.即有多少个d能够被N除尽 3 用d去乘全部已经找到的因子(包含1),假设度deg大于1.那么循环i从1到deg, 用d*i去乘全部找到的因子 找到全部因子相加,减去N,就是…
原题链接 题目大意:x的取值从0.000到2.000,输出每个x对应的y(x)的值 解法:参考了这篇日志http://www.cnblogs.com/godhand/archive/2010/04/29/1723494.html.计算的公式文章里都推导了,关键是要把握好精度和运算效率的关系.分母中含有k的多项式越多,相同循环次数的结果的精度就越高.最后,还要加上一个误差项,没有这一项可能还是要WA. 参考代码: #include<stdio.h> #include<math.h>…
Divisor Summation Problem Description Give a natural number n (1 <= n <= 500000), please tell the summation of all its proper divisors. Definition: A proper divisor of a natural number is the divisor that is strictly less than the number. e.g. numbe…
Numerical Summation of a Series Time Limit: 10 Seconds      Memory Limit: 32768 KB      Special Judge Produce a table of the values of the series Equation 1 for the 2001 values of x, x= 0.000, 0.001, 0.002, ..., 2.000. All entries of the table must h…
ZOJ题目分类初学者题: 1001 1037 1048 1049 1051 1067 1115 1151 1201 1205 1216 1240 1241 1242 1251 1292 1331 1334 1337 1338 1350 1365 1382 1383 1394 1402 1405 1414 1494 1514 1622 1715 1730 1755 1760 1763 1796 1813 1879 1889 1904 1915 1949 2001 2022 2099 2104 21…
D - Beauty of Array Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3872 Description Edward has an array A with N integers. He defines the beauty of an array as the summation of all distinct integ…
D - Beauty of Array Time Limit:2000MS     Memory Limit:65536KB     64bit IO Format:%lld & %llu Submit Status Practice ZOJ 3872 Appoint description:  System Crawler  (2015-04-30) Description Edward has an array A with N integers. He defines the beauty…
第十三届浙江省大学生程序设计竞赛 I 题, 一道模拟题. ZOJ  3944http://www.icpc.moe/onlinejudge/showProblem.do?problemCode=3944 In a BG (dinner gathering) for ZJU ICPC team, the coaches wanted to count the number of people present at the BG. They did that by having the waitre…