hdu1029

Posted 王坤1993

tags:

篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了hdu1029相关的知识,希望对你有一定的参考价值。

#include<iostream>
#include<string.h>
using namespace std;


int main()
{
int n,i;
int t;
int cnt;
int result;
while(scanf("%d",&n)!=EOF)
{
cnt=0;
for(i=0;i<n;i++)
{
scanf("%d",&t);

if(cnt==0)
{
cnt=1;
result=t;
}
else
{
if(t==result)cnt++;
else cnt--;
}

}
printf("%d\n",result);
}
return 0;
}

以上是关于hdu1029的主要内容,如果未能解决你的问题,请参考以下文章

HDU1029 简单DP

hdu1029

[2016-03-27][HDU][1029][Ignatius and the Princess IV]

hdu 1029

hdu-1029-Ignatius and the Princess IV

HDU 1020-1029