小学除法公式二年级式

扫二维码下载作业帮
3亿+用户的选择
下载作业帮安装包
扫二维码下载作业帮
3亿+用户的选择
除法的运算公式
作业帮用户
扫二维码下载作业帮
3亿+用户的选择
除法的运算公式1交换律:A÷B÷C=A÷C÷B2结合律:A÷B÷C=A÷(B×C)3分配律:A÷(B+C)=A÷B+A÷C
为您推荐:
扫描下载二维码考试指南:
备考真题:
热门杯赛:
推荐城市:
教师资源:
期中试题:
期末试题:
单元测试:
小学试题:
语文试题:
语文考点:
数学试题:
数学乐园:
英语知识点:
英语试题资源:
中国剩余理论:整数除法公式
16:31:50&&&&&&&&标签:
  中国剩余理论:整数除法公式
来源:奥数网
欢迎访问奥数网,您还可以通过手机等移动设备查询小学试题库、奥数题库、小升初动态、竞赛辅导、重点中学信息等,2018小升初我们一路相伴。
点击查看更多
奥数网微信
中考网微信
欢迎扫描二维码关注奥数网微信ID:aoshu_2003
欢迎扫描二维码关注中考网微信ID:zhongkao_com
奥数关键词hdu 1852(快速幂模+有除法的时候取模的公式)
时间: 11:47:39
&&&& 阅读:408
&&&& 评论:
&&&& 收藏:0
标签:&&&&&&&&&&&&&&&&&&&&&&&&&&&Beijing 2008
Time Limit:
MS (Java/Others)&&&&Memory Limit:
K (Java/Others)Total Submission(s): 741&&&&Accepted Submission(s): 291
Problem Description
we all know, the next Olympic Games will be held in Beijing in 2008. So
the year 2008 seems a little special somehow. You are looking forward
to it, too, aren‘t you? Unfortunately there still are months to go. Take
it easy. Luckily you meet me. I have a problem for you to solve. Enjoy
your time.Now given a positive integer N, get the sum S of all positive integer divisors of 2008N.
Oh no, the result may be much larger than you can think. But it is OK
to determine the rest of the division of S by K. The result is kept as
M.Pay attention! M is not the answer we want. If you can get 2008M,
that will be wonderful. If it is larger than K, leave it modulo K to
the output. See the example for N = 1,K = 10000: The positive integer
divisors of 20081 are 1、2、4、8、251、502、,S = 3780, M = M % K = 5776.
input consists of several test cases. Each test case contains a line
with two integers N and K (1 & N & 0 & K & 10000). N = K = 0
ends the input file and should not be processed.
For each test case, in a separate line, please output the result.
Sample Input
Sample Output
收获挺大的!。以前对于除法模运算只知道用逆元可以算,,但是当两个数不互素的时候就不知道怎么弄了。今天得到了两个公式。。第一个公式自己做的时候想到了可能可以,然后真的AC了,然后去验证发现真的有:
1.(a/b)%mod=a%(b*mod)/b%(get这个公式好激动)
2.(a/b)%mod=a*b^(mod-2)%mod,mod为素数(可以通过逆元证明)(这个公式的话感觉如果mod为素数的话,直接用逆元也一样的,,可以参考我博客hdu1452)
然后这个题并不难,把2008分解成 251*2^3 然后求因子和用第一个公式去掉分母250,然后可以得到M,在用快速幂计算就好了。
#include &stdio.h&
#include &iostream&
using namespace
typedef long long LL;
LL pow_mod(LL a,LL n,LL mod){
LL ans = 1;
if(n&1) ans = a*ans%
int main()
while(scanf("%lld%lld",&N,&K)!=EOF,N&&K)
K = 250*K;
LL M = ((pow_mod(251,N+1,K)-1)*(pow_mod(2,3*N+1,K)-1))%K;
M = M/250;
LL ans =pow_mod(2008,M,K);
printf("%lld\n",ans);
标签:&&&&&&&&&&&&&&&&&&&&&&&&&&&原文:http://www.cnblogs.com/liyinggang/p/5522847.html
教程昨日排行
&&国之画&&&& &&&&&&
&& &&&&&&&&&&&&&&
鲁ICP备号-4
打开技术之扣,分享程序人生!

我要回帖

更多关于 除法算式四年级100道 的文章

 

随机推荐