# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
250939 | huuducpro | Street Lamps (APIO19_street_lamps) | C++14 | 3218 ms | 156944 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,A[300002];
int bb[300002],ll[300002],rr[300002],len[300002];
int ss[300002];
struct query
{
int type,a,b;
};
query Q[300002];
void update(int i,int val)
{
for (i;i<=n;i+=i&(-i))
bb[i]+=val;
}
int get(int i)
{
int ans=0;
for (i;i>=1;i-=i&(-i))
ans+=bb[i];
return ans;
}
int getl(int a)
{
int ans=a;
int d=1;int c=a-1;int t=get(a-1);
while (d<=c)
{
int mid=(d+c)/2;
if (t-get(mid-1)==a-mid)
Compilation message (stderr)
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |