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 |
我究竟是错在哪了???// 2535 #include<iostream> #include<cstdio> #include<cstring> using namespace std; #define INF 10000000 #define Max(a,b) (a>b?a:b) #define Min(a,b) (a>b?b:a) int ps[101]; int low[101]; // i ??????; int high[101]; // i ??????; int main () { int n,p,i,j,css; int max,min,mid; while(cin>>n>>p) { css=1; for(i=0;i<101;i++) { high[i]=0; low[i]=0; } while(n--) { max=-1; min=INF; for(i=1;i<=p;i++) { scanf("%d",&ps[i]); max=Max(max,ps[i]); min=Min(min,ps[i]); } for(i=1;i<=p;i++) { if(ps[i]==max) high[i]++; if(ps[i]==min) low[i]++; } } for(i=1;i<=p;i++) { mid=(n/2)+(n%2); if(low[i]>=mid&&high[i]==0) { printf("%d ",i); css=0; } } if(css==1) printf("0"); printf("\n"); } return 0; } Followed by: Post your reply here: |
All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator