下载此文档

简单计算题三.pptx


文档分类:高等教育 | 页数:约40页 举报非法文档有奖
1/40
下载提示
  • 1.该资料是网友上传的,本站提供全文预览,预览什么样,下载就什么样。
  • 2.下载该文档所得收入归上传者、原创者。
  • 3.下载的文档,不会出现我们的网址水印。
1/40 下载此文档
文档列表 文档介绍
初赛完成情况统计通过4题:Team280110通过3题:8311,Wzlxdzjy,xygy8860通过2题:Supermokey369,zhlean,2804302029,clstone,wulidianzixueyuan通过1题:w180285,Taozle123,JAG未过题:zhengguifu,wanglikai91,luojiangbo,fuhang8902317AntsRun!Description    ?Areyouaskingwhyheplayswithantsinsteadofothers?Ah,becauseantistheonlynon-plantlivingthingwhichcanbefoundinQingshuiheCampusofUESTCapartfromhumanbeings.     Thistime,,,, ThefirstlineoftheinputisT(nomorethan10000),whichstandsforthenumberoftestcasesyouneedtosolve. Eachtestcasebeginswith“NR”(withoutquotes)-thnumberisthespeed(cm/s)ofthei- Ifthegamecanlastforever,print“Inf”inasingleline,otherwisepleaseoutputthelongesttimeinsecondseachgamecanlast, 31 111 31 321SampleOutputInf ,3只蚂蚁连环追第一只追第二只第二只追第三只第三只追不上第一只所有蚂蚁都是相同速度则inf最最关键的是Pi,如何计算(造成WrongAnswer的主要原因)acos(-)#include<>  #include<>   double pi=acos(-);int v[30];  int main()  {      int t,p,n,i;      double r;      scanf("%d",&t);      for (p=1;p<=t;p++)      {          scanf("%d",&n);          scanf("%lf",&r);          for (i=1;i<=n;i++)              scanf("%d",&v[i]);          v[0]=v[n];          int s=0;          for (i=1;i<=n;i++)              if (v[i-1]>v[i]) s=s+v[i-1]-v[i];          if (s==0) printf("Inf\n");          else printf("%.3lf\n",2*pi*r/s);      }      return 0; }ArchimedesDescription    Mr

简单计算题三 来自淘豆网m.daumloan.com转载请标明出处.

相关文档 更多>>
非法内容举报中心
文档信息
  • 页数40
  • 收藏数0 收藏
  • 顶次数0
  • 上传人wz_198613
  • 文件大小570 KB
  • 时间2019-04-17
最近更新