Submission #15295

#TimeUsernameProblemLanguageResultExecution timeMemory
15295sujin달리는 게임 (kriii3_E)C++98
0 / 70
1 ms12840 KiB
#include <cstdio> #define N 1000001 int n,a[N],t[100][100]; long long s[N],q,mx; int main () { int i,j; long long as; scanf ("%d",&n); for (i=1;i<=n;i++) scanf ("%d",a+i),s[i]=s[i-1]+a[i]; for (i=1;i<=n;i++) for (q=0,j=i;j>=1;j--) { q+=s[i]-s[j-1]; if (mx<q) mx=q; } printf ("%lld\n",mx); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...