BestCoder Round #50 (div.1) 1001 Distribution money (HDU OJ 5364)

时间:2023-03-09 15:12:42
BestCoder Round #50 (div.1) 1001 Distribution money (HDU OJ 5364)

题目:Click here

题意:bestcoder上面有中文题目

 #include <iostream>
#include <cstdio>
#include <cstring>
#include <algorithm>
#include <cmath>
#include <string>
#include <climits>
#include <vector>
#include <queue>
#include <stack>
#define F first
#define S second
typedef long long ll;
using namespace std;
const double PI = 3.14159265;
const double E = 2.718281828459;
const double EPS=1e-;
const int M = 1e5+;
const int MOD = 1e9+;
const int INF = 0x3f3f3f3f; int n;
int a[M];
int main() {
#ifdef ONLINE_JUDGE
#else
freopen( "in.txt", "r", stdin );
#endif
while( ~scanf("%d", &n ) ) {
memset( a, , sizeof(a) );
for( int i=; i<n; i++ ) {
int x;
scanf("%d", &x );
a[x]++;
}
bool ok = true;
bool first = true;
for( int i=; i<=1e5; i++ ) {
if( a[i] > n-a[i] ) {
if( first ) {
ok = false;
first = false;
printf("%d", i );
}
else {
printf(" %d", i );
}
}
}
if( ok )
printf("-1");
printf("\n");
}
return ;
}