# |
Submission time |
Handle |
Problem |
Language |
Result |
Execution time |
Memory |
16609 |
2015-08-29T14:02:30 Z |
eaststar |
달리는 게임 (kriii3_E) |
C++14 |
|
0 ms |
8892 KB |
#include <stdio.h>
int a[1000010],chk[1000010];
long long ans,s,cnt;
int main(){
int i,n;
scanf("%d",&n);
for(i=1;i<=n;++i)scanf("%d",a+i);
for(;i;){
for(;a[i]<=0;--i);
s=0;
for(;i&&a[i]+s>0;s+=a[i--])chk[i]=1;
}
for(i=1;i<=n;++i){
for(cnt=1;i<=n&&chk[i];)ans+=a[i++]*(cnt++);
}
printf("%lld",ans);
return 0;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Runtime error |
0 ms |
8892 KB |
SIGSEGV Segmentation fault |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Halted |
0 ms |
0 KB |
- |