【神奇の做法】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 }

 

posted @ 2014-10-29 21:55  AutSky_JadeK  阅读(165)  评论(0)    收藏  举报
TVアニメ「Charlotte(シャーロット)」公式サイト TVアニメ「Charlotte(シャーロット)」公式サイト