Online Judge | Problem Set | Authors | Online Contests | User | ||||||
---|---|---|---|---|---|---|---|---|---|---|
Web Board Home Page F.A.Qs Statistical Charts | Current Contest Past Contests Scheduled Contests Award Contest |
大牛们 帮我看看 郁闷 WA了。。。。哪错了?#include<iostream> #include <stdio.h> using namespace std; #define M 500 int a[M]; int b[M]; int c[M]; int main() { int n,m,d,min,j,i,k,t; cin>>n; while(n--) { k=0; t=0; cin>>m; float p=0.000; for(j=0;j<m;j++) { cin>>b[j]; for(i=0;i<2*b[j];i++) cin>>a[i]; i=0; c[k]=0; do{ if(c[k]<a[i]) { c[k]=a[i]; c[k+1]=a[i+1]; } i++; }while(i<2*b[j]); k+=2; } min=c[0]; for(d=2;d<k;d+=2) { if(min>c[d]) min=c[d]; } for(d=1;d<k;d+=2) t+=c[d]; p=float(min)/t; printf("%.3lf\n",p); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator