分析:
空间1MB。。。。
次数大于n/2是解题关键。
#include using namespace std; int n,x,y,tot; main() { scanf("%d",&n); while (n--) { scanf("%d",&y); if (!tot) tot++,x=y; else { if (y!=x) tot--; else tot++; } } printf("%d",x); }
bzoj 2456: mode