Submission #389661

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
3896612021-04-14 11:03:37denkendoemeerTwo Antennas (JOI19_antennas)C++14
13 / 100
162 ms33220 KiB
#include<bits/stdc++.h>
#define ll long long
const int inf=1e9;
using namespace std;
int h[200005],a[200005],b[200005],ans[200005],ql[200005],qr[200005],lazy[550000],n;
vector<int>t[200005],t1[200005],t2[200005];
array<int,2>aint[550000];
void upd(int nod,int x)
{
aint[nod][1]=max(aint[nod][0]+x,aint[nod][1]);
lazy[nod]=max(lazy[nod],x);
}
void push(int nod)
{
upd(2*nod,lazy[nod]);
upd(2*nod+1,lazy[nod]);
lazy[nod]=-inf;
}
void update1(int nod,int st,int dr,int poz,int val)
{
if (st==dr){
aint[nod][0]=val;
return ;
}
push(nod);
int mij=(st+dr)/2;
if (poz<=mij)
update1(nod*2,st,mij,poz,val);
else
update1(nod*2+1,mij+1,dr,poz,val);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

antennas.cpp: In function 'int main()':
antennas.cpp:81:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   81 |     scanf("%d",&n);
      |     ~~~~~^~~~~~~~~
antennas.cpp:83:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   83 |         scanf("%d%d%d",&h[i],&a[i],&b[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~~~~
antennas.cpp:88:10: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   88 |     scanf("%d",&q);
      |     ~~~~~^~~~~~~~~
antennas.cpp:91:14: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   91 |         scanf("%d%d",&ql[i],&qr[i]);
      |         ~~~~~^~~~~~~~~~~~~~~~~~~~~~
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...