Online JudgeProblem SetAuthorsOnline ContestsUser
Web Board
Home Page
F.A.Qs
Statistical Charts
Problems
Submit Problem
Online Status
Prob.ID:
Register
Update your info
Authors ranklist
Current Contest
Past Contests
Scheduled Contests
Award Contest
User ID:
Password:
  Register

我究竟是错在哪了???

Posted by 913106840245 at 2014-08-23 12:22:56 on Problem 2535
// 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:
User ID:
Password:
Title:

Content:

Home Page   Go Back  To top


All Rights Reserved 2003-2013 Ying Fuchen,Xu Pengcheng,Xie Di
Any problem, Please Contact Administrator