摘要:
源代码: #include<cstdio> int m,n,q,ans=1; int main() { scanf("%d%d%d",&m,&n,&q); //m的n次方,对q的取余运算。 m%=q; //为避免m*m率先溢出,首当其冲,对其进行取余运算。 while (n) { if (n&1) 阅读全文
摘要:
一、构造质数表 (1)试除法 源代码: #include<cstdio> int n,s(1),i[1001]; int main() { scanf("%d",&n); i[1]=2; printf("2 "); for (int a=3;s<n;a++) { bool t(0); for (in 阅读全文
摘要:
源代码: #include<cstdio> int n,i[1001][1001]; const int maxint=10000000; int main() { scanf("%d",&n); for (int a=1;a<=n;a++) for (int b=1;b<=n;b++) { sca 阅读全文
摘要:
源代码: #include<cstdio> int i[1001][1001],n,k; bool f[1001]={0}; const int maxint=1061109567; int main() { scanf("%d%d",&n,&k); for (int a=1;a<=n;a++) f 阅读全文
摘要:
源代码: #include<cstdio> int m,n,h[1001]={0}; bool f[1001][1001]={0}; const int maxint=1061109567; int main() { scanf("%d%d",&n,&m); for (int a=1;a<=m;a+ 阅读全文
摘要:
源代码: #include<cstdio> #include<cstring> int m(1),n,k,i[1001],x[1001],y[1001],f[1001]; int main() { scanf("%d%d",&n,&k); for (int a=1;a<=n;a++) for (in 阅读全文