/in/foo.cc:1:20: warning: extra tokens at end of #include directive
#include<iostream> #include<algorithm> using namespace std; int sum[5001],ans[5001],n,a,maxm=-0x7f; int main(){ cin>>n; for(int i=1;i<=n;i++) { cin>>a; sum[i]=sum[i-1]+a; ans[i]=ans[i-1]+a*sum[i-1]; } for(int i=1;i<=n-1;i++) for(int j=i+1;j<=n;j++) { int t=ans[j]-ans[i]-sum[i]*(sum[j]-sum[i]); maxm=max(t,maxm); } cout<<maxm<<endl; return 0; }
^
/usr/lib/gcc/x86_64-linux-gnu/6/../../../x86_64-linux-gnu/Scrt1.o: In function `_start':
(.text+0x20): undefined reference to `main'
collect2: error: ld returned 1 exit status