Title: Click Here
Test instructions: Bestcoder with Chinese title
1#include <iostream>2#include <cstdio>3#include <cstring>4#include <algorithm>5#include <cmath>6#include <string>7#include <climits>8#include <vector>9#include <queue>Ten#include <stack> One #defineF First A #defineS Second -typedefLong Longll; - using namespacestd; the Const DoublePI =3.14159265; - Const DoubleE =2.718281828459; - Const Doubleeps=1e-8; - Const intM = 1e5+5; + Const intMOD = 1e9+7; - Const intINF =0x3f3f3f3f; + A intN; at intA[m]; - intMain () { - #ifdef Online_judge - #else -Freopen ("In.txt","R", stdin); - #endif in while(~SCANF ("%d", &N)) { -Memset (A,0,sizeof(a)); to for(intI=0; i<n; i++ ) { + intx; -scanf"%d", &x); thea[x]++; * } $ BOOLOK =true;Panax Notoginseng BOOLFirst =true; - for(intI=0; i<=1e5; i++ ) { the if(A[i] > N-A[i]) { + if(first) { AOK =false; theFirst =false; +printf"%d", i); - } $ Else { $printf"%d", i); - } - } the } - if(OK)Wuyiprintf"-1"); theprintf"\ n"); - } Wu return 0; -}
Bestcoder Round #50 (Div.1) 1001 Distribution Money (HDU OJ 5364)