Submission #250939

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2509392020-07-19 14:07:01huuducproStreet Lamps (APIO19_street_lamps)C++14
100 / 100
3218 ms156944 KiB
#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)
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

street_lamps.cpp: In function 'void update(int, int)':
street_lamps.cpp:13:11: warning: statement has no effect [-Wunused-value]
     for (i;i<=n;i+=i&(-i))
           ^
street_lamps.cpp: In function 'int get(int)':
street_lamps.cpp:19:11: warning: statement has no effect [-Wunused-value]
     for (i;i>=1;i-=i&(-i))
           ^
street_lamps.cpp: In function 'void build_bit2d()':
street_lamps.cpp:74:23: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
         for (int j=0;j<st[i].size();j++)
                      ~^~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...