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 |
答案对了提交不了,咋回事!!急急急#include <stdio.h> int main() { int m,n,a[1000]; int num,i,j,k,z,b[1000]; int max,flag; int count=0; while(scanf("%d%d",&m,&n)&&(m&&n)) { num=0; z=0; for(i=0;i<n;i++) { scanf("%d",&a[i]); } for(j=n*m;j>0;j--) { flag=0; for(k=0;k<n;k++) { if(j==a[k]) { num++; b[z]=num; z++; flag=1; } } if(flag==0) { num--; b[z]=num; z++; } } max=b[0]; for(k=0;k<n;k++) { if(max<b[k]) max=b[k]; } printf("Case %d: %d\n",++count,max); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator