初赛完成情况统计通过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,3111131321SampleOutputInf,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转载请标明出处.