标签:string i++ while namespace out main cstring int lse
#include<iostream> #include<cstring> #include<cmath> #include<cstdio> #include<algorithm> #include<stack> #include<queue> using namespace std; const int N = 1000005; int a[N]; int main() { int n; while(cin>>n&&n) { int num=0; int ans=-1; for(int i=0;i<n;i++) { cin>>a[i]; if(num==0) { ++num; ans=a[i]; } else { if(ans!=a[i]) num--; else num++; } } cout<<ans<<endl; } }
Ignatius and the Princess IV HDU - 1029 基础dp
标签:string i++ while namespace out main cstring int lse
原文地址:https://www.cnblogs.com/QingyuYYYYY/p/12237972.html