Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 21436 Accepted: 8775 Special Judge Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains…
Find The Multiple Time Limit: 1000MS Memory Limit: 10000K Total Submissions: 18390 Accepted: 7445 Special Judge Description Given a positive integer n, write a program to find out a nonzero multiple m of n whose decimal representation contains…
完全想不到啊,同余模定理没学过啊,想起上学期期末考试我问好多同学'≡'这个符号什么意思,都说不知道,你们不是上了离散可的吗?不过看了别人的解法我现在会了,同余模定理介绍及运用点这里点击打开链接 简单说一下同余模定理:如果(a - b) / m = 0,说明a%m等于b%m,那么对于本题应该如何运用呢? 已知a % n = m,那么(a * 10 + x) % n = a * 10 % n + x % n = (a % n * 10 + x ) % n = (m *10 + x ) % n,有了…
题意:给出一大数K(4 <= K <= 10^100)与一整数L(2 <= L <= 106),K为两个素数的乘积(The cryptographic keys are created from the product of two primes) 问构成K的最小素数是否绝对小于L,若是,则输出BAD p,p为最小素数,否则输出GOOD; 分析:从小到大枚举1~10^6内的素数p,while(p<L)时,判断K是否能被p整除,若能则证明构成K的最小素数绝对小于L,反之则大于L…