【神奇の做法】bzoj2456 mode
题解:http://www.tuicool.com/articles/BfQBzif
1 #include<cstdio> 2 using namespace std; 3 int n,x,ans,tot; 4 int main() 5 { 6 scanf("%d",&n); 7 for(;n>0;n--) 8 { 9 scanf("%d",&x); 10 if(!tot) {ans=x; tot=1;} 11 else if(x==ans) tot++; 12 else tot--; 13 } 14 printf("%d\n",ans); 15 return 0; 16 }
——The Solution By AutSky_JadeK From UESTC
转载请注明出处:http://www.cnblogs.com/autsky-jadek/

浙公网安备 33010602011771号
