标签:
#include<iostream> #include<cstdio> #include<cstring> using namespace std; int n; int bac(int s) { return (1890*s+143)%10007; } int b[100005],a[100005]; int main() { while(scanf("%d",&n)!=EOF) { memset(b,0,sizeof(b)); memset(a,0,sizeof(a)); int re=0; for(int i=0;i<n;i++) { scanf("%d",&a[i]); re=re+a[i]; b[i]=bac(a[i])-a[i]; } // int exm=0; int maxn=0; for(int i=1;i<n;i++) { if(b[i]+b[i-1]>b[i]) b[i]=b[i]+b[i-1]; if(b[i]>maxn) maxn=b[i]; } printf("%d\n",re+maxn); } return 0; }
标签:
原文地址:http://www.cnblogs.com/hsd-/p/5008883.html