应该秒切的水题
#include <iostream>
#include <cstring>
#include <algorithm>
#include <cstdio>
#include <vector>
#define N 10007
using namespace std;
int t,n,w,f[N];
int cal ( int w )
{
return 10000 - ( 100 - w ) * ( 100 - w );
}
int main ( )
{
scanf ( "%d" , &t );
int c = 1;
while ( t-- )
{
memset ( f , 0 , sizeof( f ) );
scanf ( "%d" , &n );
for ( int i = 1 ; i <= n ; i++ )
{
scanf ( "%d" , &w );
f[cal(w)]++;
}
vector<int> v;
int maxn = -1;
int mark = 0;
for ( int i = 0 ; i <= 10000 ; i++ )
maxn = max ( maxn , f[i] );
for ( int i = 0 ; i <= 10000 ; i++ )
if ( f[i] == maxn ) v.push_back ( i ),mark+=f[i];
int len = v.size();
printf ( "Case #%d:\n" , c++ );
if ( len != 1 && mark == n )
printf ( "Bad Mushroom" );
else
{
for ( int i = 0 ; i < len-1 ; i++ )
printf ("%d " , v[i] );
printf ( "%d" , v[len-1] );
}
puts ( "" );
}
}