acm2-czm初等数论.ppt

  1. 1、本文档共23页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
acm2-czm初等数论

初等数论 曹沾懋 caozhanmao@ 134 2414 8775 内涵 数 整数 正整数 单双,奇偶,质数,素数 数之间关系:互素,最小公倍数, 集合中的素数个数,计数 同余, 若干常用结论 数论(简单统计经验性结论) 以素数判断和同余为模型构造出来的题目往往需要较多的数论知识来解决, 竞赛中的比重不大,来上一道,也使不备的人花时间走迷宫。 素数判断和同余最常见的是在以密码学为背景的题目中出现,在运用密码学常识确定大概的过程之后,核心算法往往要涉及数论的内容。 数学 / 数论(过往题大体的内容涵盖,简单统计) 最大公约数 ????????????? Euclid算法 ???????????????????? 扩展的Euclid算法 ??????????????????????????? 同余方程 / 二元一次不定方程 ??????????????????????????? 同余方程组 数论计算 ????????????? 求N的约数个数 ????????????? 求phi(N) =?(N) ????????????? 求约数和 ????????????? ……?????? 素数问题 输入的数字之间进行某种运算,设计Program 试对下述问题用程序打印若干方案 一个桶装满10斤油,另外有一个能装3斤油的空桶和一个能装7斤油的空桶。试用这三个桶把10斤油平分为两份。 10-3-3-3=1 9-7=2 2+3=5, 余数理论,    数模运算及其规律 有大、中、小三个酒桶,分别能装19斤、13斤、7斤酒。现在大桶空着,另外两个桶都装满了酒。试问:用这三个桶倒几次可以把全部酒平分成两份? 自己练,并给出程序, 问题:1001 Please calculate the coefficient modulo 2 of x^i in (1+x)^n. Input For each case, there are two integers n, i (0=i=n=2^31-1) Output For each case, print the coefficient modulo 2 of x^i in (1+x)^n on a single line. Sample Input 3 1 4 2 Sample Output 1 0 Author: ZHANG, Rui Your brain , storming? 蛮力法? Here is a sample solution for problem 1001 using C++: #include iostream using namespace std; int main() { int a,b; while(cin a b) cout a+b endl; } Here is a sample solution for problem 1001 using C: #include stdio.h int main() { int a,b; while(scanf(%d %d,a, b) != EOF) printf(%d\n,a+b); } Here is a sample solution for problem 1001 using PASCAL(both GPCFPC): program p1001(Input,Output); var a,b:Integer; begin while not eof(Input) do begin Readln(a,b); Writeln(a+b); end; end. v5,No.1913, Euclids Game Time limit: 1 Seconds?? Memory limit: 32768K Total Submit: 1820?? Accepted Submit: 682?? Two players, Stan and Ollie, play, starting with two natural numbers. Stan, the first player, subtracts any positive multiple of the lesser of the two numbers from the greater of the two numbers, provided that the resulting number must be nonnegative. Then Ollie, the second player, does the same with the two resulting numbers, then Stan, etc., alternately, unti

文档评论(0)

dajuhyy + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档