mirror of
https://github.com/Kiritow/OJ-Problems-Source.git
synced 2024-03-22 13:11:29 +08:00
28 lines
512 B
C++
28 lines
512 B
C++
|
#include<stdio.h>
|
||
|
int main()
|
||
|
{
|
||
|
long n,num,cnt,res;
|
||
|
while(EOF != scanf("%d",&n))
|
||
|
{
|
||
|
cnt = 0;
|
||
|
while(n--)
|
||
|
{
|
||
|
scanf("%d",&num);
|
||
|
if(0 == cnt)
|
||
|
{
|
||
|
res = num;
|
||
|
cnt++;
|
||
|
}
|
||
|
else
|
||
|
{
|
||
|
if(res == num)
|
||
|
cnt++;
|
||
|
else
|
||
|
cnt--;
|
||
|
}
|
||
|
}
|
||
|
printf("%d\n",res);
|
||
|
}
|
||
|
return 0;
|
||
|
}
|