ACM课件lecture老少皆宜数学题.ppt_第1页
ACM课件lecture老少皆宜数学题.ppt_第2页
ACM课件lecture老少皆宜数学题.ppt_第3页
ACM课件lecture老少皆宜数学题.ppt_第4页
ACM课件lecture老少皆宜数学题.ppt_第5页
已阅读5页,还剩70页未读 继续免费阅读

下载本文档

版权说明:本文档由用户提供并上传,收益归属内容提供方,若内容存在侵权,请进行举报或认领

文档简介

ACM程序设计 *1 第二讲 老少皆宜之数学题 Date2 今天, 你 了吗? AC Date3 开胃羹(1) n几个常用单词: 1、vertex ( vertices ) 顶点 2、polygon 多边形 3、convex 凸的 4、concave 凹的 5、segment (线)段(n);分割(v) Date4 开胃羹(2) n再来几个: 1、integer 整数 2、positive 正的 3、negative (adj)负的; (n)负数 4、factorial (n)阶乘;(adj)因子的,阶乘的 5、digital (n)数字;(adj)数字的 Date5 ACM数学题特点分析: n题意容易理解 n算法相对简单(有些很难的!) n编程比较容易 nACM/ICPC入门练习的好选择 下面,分类介绍: Date6 从首届“舜宇”杯说起 Date7 比赛背景 由于前一年的邀请赛很多学校没有做出一道 题,所以,这次的比赛特意准备了几道简单 的题目,目的就是让大多数的学校都能拿个 气球回去,也好有个交待,于是有 Date8 第一类 傻 瓜 型 2019/1/129 1004: Let the Balloon Rise Date10 Problem Description nContest time again! How excited it is to see balloons floating around. But to tell you a secret, the judges favorite time is guessing the most popular problem. When the contest is over, they will count the balloons of each color and find the result. This year, they decide to leave this lovely job to you. Date11 Input nInput contains multiple test cases. Each test case starts with a number N (0 =2). Date35 nInput nInput consists of a sequence of lines, each containing an integer n. (n nint main() n n long n; n while(scanf(“%ld“, n else n printf(“non“); nreturn 0; n Date39 回到正题大锤搞定 Date40 1005: Number Sequence Date41 nA number sequence is defined as follows: f(1) = 1, f(2) = 1, n f(n) = (A * f(n - 1) + B * f(n - 2) mod 7. Given A, B, and n, you are to calculate the value of f(n). nProblem Description Date42 nInput nThe input consists of multiple test cases. Each test case contains 3 integers A, B and n on a single line (1 nint main() n int m,n,t; nint i,j; n int flag; nint a,b,c; flag=0; 不知道m到n有多少个水仙花数, 怎么控制最后一个数后不空格? Date70 nwhile(scanf(“%d%d“,i=n;i+) n na=i/100; / a=i/100 nb=(i-a*100)/10; / b=(i%100)/10 nc=i-a*100-b*10; /c=i%10; nj=a*a*a+b*b*b+c*c*c; n Date71 nif(i=j) n nprintf(“%d “,i); nflag=1; n n nif(i=j) n nif(flag=1) n printf(“ “); nprintf(“%d“,i); nflag=1; n n 不知道m到n有多少个水仙花数,怎么控制最后一个数后 不空格? Date

温馨提示

  • 1. 本站所有资源如无特殊说明,都需要本地电脑安装OFFICE2007和PDF阅读器。图纸软件为CAD,CAXA,PROE,UG,SolidWorks等.压缩文件请下载最新的WinRAR软件解压。
  • 2. 本站的文档不包含任何第三方提供的附件图纸等,如果需要附件,请联系上传者。文件的所有权益归上传用户所有。
  • 3. 本站RAR压缩包中若带图纸,网页内容里面会有图纸预览,若没有图纸预览就没有图纸。
  • 4. 未经权益所有人同意不得将文件中的内容挪作商业或盈利用途。
  • 5. 人人文库网仅提供信息存储空间,仅对用户上传内容的表现方式做保护处理,对用户上传分享的文档内容本身不做任何修改或编辑,并不能对任何下载内容负责。
  • 6. 下载文件中如有侵权或不适当内容,请与我们联系,我们立即纠正。
  • 7. 本站不保证下载资源的准确性、安全性和完整性, 同时也不承担用户因使用这些下载资源对自己和他人造成任何形式的伤害或损失。

评论

0/150

提交评论