摘要: 最大质因数和(prime) 题目描述 定义一个数的质因数和为它的所有质因数之和。给出n个正整数,对于每个正整数,输出2到这个数之间所有数中质因数和最大的数的质因数和。 输入格式 第一行一个正整数n(n<=500000),接下来n行每行有一个正整数ai(2<=ai<=1000000)。 输出格式 共n行,对于每一个ai输出符合题意的结果。 样例输入 1 2 样例输出 2解法:先生成1000000以内所有数的质因数和(利用类似筛法求素数),然后数组s中存最大的质因数和,且有递推式s[i]=max(s[i-1],a[i]),然后读入,再从s中读取const max=1000000; 阅读全文
posted @ 2011-04-14 08:57 Mose 阅读(230) 评论(0) 推荐(0) 编辑
摘要: Word IndexTime Limit: 1000MSMemory Limit: 10000KTotal Submissions: 3200Accepted: 1831DescriptionEncodingschemes are often used in situations requiring encryption orinformation storage/transmission economy. Here, we develop a simpleencoding scheme that encodes particular types of words with five orfe 阅读全文
posted @ 2011-04-14 08:52 Mose 阅读(239) 评论(0) 推荐(0) 编辑