标签:参与者 比较 ons 判断 set amp class bsp str
1 #include <cstdio> 2 #include <iostream> 3 #define N 100010 4 using namespace std; 5 int n,ans,a[N],sum[N]; 6 int main() 7 { 8 scanf("%d",&n); 9 for (int i=1;i<=n;i++) scanf("%d",&a[i]),sum[i]=sum[i-1]+a[i]; 10 for (int i=1;i<=n-ans;i++) 11 for (int j=i+ans+1;j<=n;j+=2) 12 if ((sum[j]-sum[i-1])*2==j-i+1) ans=max(ans,j-i+1); 13 printf("%d",ans); 14 }
标签:参与者 比较 ons 判断 set amp class bsp str
原文地址:https://www.cnblogs.com/Comfortable/p/10316888.html