# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
891572 | khoquennguoiminhthuong | Sum Zero (RMI20_sumzero) | C++14 | 273 ms | 29264 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
using namespace std;
int n,q;
int a[400005];
map<long long,int>dd;
int l[400005];
int nxt[400005];
int pa[20][100005];
int main()
{
ios_base::sync_with_stdio(0);cin.tie(0);cout.tie(0);
cin>>n;
for(int i=1;i<=n;i++)cin>>a[i];
for(int i=1;i<=n;i++)l[i]=n+1;
long long sum=0;
dd[0]=n;
for(int i=n;i>=1;i--)
{
sum+=a[i];
if(dd.count(sum))
{
l[i]=dd[sum];
}
dd[sum]=i-1;
}
int pos=n+1;
int minn=2e9;
for(int i=n;i>=1;i--)
{
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |