摘要: 求余数原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=205 1 #include 2 #include 3 #include 4 #define mod 10003 5 using namespace std; 6 char num[1000005]; 7 int main() 8 { 9 int m;10 scanf("%d",&m);11 while(m--)12 {13 scanf("%s",num);14 int len=strlen(num),ans=0;15... 阅读全文
posted @ 2013-07-08 20:08 EtheGreat 阅读(148) 评论(0) 推荐(0) 编辑
摘要: 最大素因子原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=520分析:先筛素数,同时记录下素数的序号,然后质因数分解。 1 2 #include 3 #include 4 #include 5 #define maxn 1000005 6 using namespace std; 7 int cnt,num; 8 long long n; 9 bool flag[maxn]={0};10 int prime[maxn];11 int count[maxn]={0};12 int por[maxn];13 int cpor[maxn.. 阅读全文
posted @ 2013-07-08 18:20 EtheGreat 阅读(188) 评论(0) 推荐(0) 编辑
摘要: 数的长度原题链接:http://acm.nyist.net/JudgeOnline/problem.php?pid=69分析:先看看求n!的朴素算法,用大整数乘法来实现。 1 #include 2 #include 3 #include 4 using namespace std; 5 int wei[1000000]; 6 int main() 7 { 8 int t,n; 9 scanf("%d",&t);10 while(t--)11 {12 memset(wei,0,sizeof(wei));13 int cnt=0;14... 阅读全文
posted @ 2013-07-08 17:12 EtheGreat 阅读(177) 评论(0) 推荐(0) 编辑