
Time Limit:2000MS Memory Limit:65536KB 64bit IO Format:%I64d & %I64u
Description
The difficulty here lies in diverse meanings of the term "simple" amongst the jury members. So, the jury uses the following procedure to reach a consensus: each member weights each proposed problem with a positive integer "complexity rating" (not necessarily different for different problems). The jury member calls "simplest" those problems that he gave the minimum complexity rating, and "hardest" those problems that he gave the maximum complexity rating.
The ratings received from all jury members are then compared, and a problem is declared as "very simple", if it was called as "simplest" by more than a half of the jury, and was called as "hardest" by nobody.
Input
Output
Sample Input
4 4
1 1 1 2
5 900 21 40
10 10 9 10
3 4 3 5
Sample Output
3
/*
题意:有n位评委,给p个选手打分,让你找出very simple的选手,有这样一个标准就是给他打最低分的评委数量超过一半,并且没有评委给他打过最低分 初步思路:模拟
*/
#include <iostream>
#include <stdio.h>
#include <string.h>
using namespace std;
int n,p;
int a[][];
int cur[];//用来标记每个选手的最低分得票 cur[i]==-1表示这个选手的过最高分,那么他的积分就不做评价
int maxn,minn;
void init(){
memset(cur,,sizeof cur);
}
int main(){
// freopen("in.txt","r",stdin);
while(scanf("%d%d",&n,&p)!=EOF){
init();
for(int i=;i<n;i++){
maxn=-;
minn=;
for(int j=;j<p;j++){
scanf("%d",&a[i][j]);
if(a[i][j]>maxn){
maxn=a[i][j];
}
if(a[i][j]<minn){
minn=a[i][j];
}
}
for(int j=;j<p;j++){
if(a[i][j]==maxn)
cur[j]=-;
else if(a[i][j]==minn){
if(cur[j]==-)
continue;
else
cur[j]++;
} }
}
// for(int i=0;i<n;i++){
// cout<<cur[i]<<" ";
// }
// cout<<endl;
bool flag=false;
for(int i=;i<n;i++){
if(cur[i]>n/){
if(flag){
printf(" %d",i+);
}else{
printf("%d",i+);
flag=true;
}
}
}
if(flag==false)
printf("");
printf("\n");
}
return ;
}