Submission #1023261

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
10232612024-07-14 14:23:22VanioSegments (IZhO18_segments)C++17
Compilation error
0 ms0 KiB
#include<bits/stdc++.h>
using namespace std;
struct segment{
int l,r;
};
segment seg[200001];
bool fff(segment p, segment q){
return p.r-p.l>q.r-q.l;
}
struct block{
int mi=INT_MAX,ma=-1;
vector<int> vl,vr;
};
block b[501];
struct query{
int l,r,k;
};
query qs[200001];
int n,m,t,nextSegmentId,lastans,bsz;
set<int> segmentIds;
int main()
{
ios_base::sync_with_stdio(false);
cin.tie(NULL);
cout.tie(NULL);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

segments.cpp: In function 'int main()':
segments.cpp:54:6: error: 'segments' was not declared in this scope; did you mean 'segment'?
   54 | sort(segments+1,segments+1+m,fff);
      |      ^~~~~~~~
      |      segment
segments.cpp:71:5: error: redeclaration of 'int ans'
   71 | int ans,j,g;
      |     ^~~
segments.cpp:32:19: note: 'int ans' previously declared here
   32 | int i,qt,l,r,id,k,ans,f=0;
      |                   ^~~
segments.cpp:76:81: error: 'struct segment' has no member named 'k'
   76 |             auto it = lower_bound(b[j].vl.begin(),b[j].vl.end(),seg[i].r-seg[i].k+2);
      |                                                                                 ^
segments.cpp:78:81: error: 'struct segment' has no member named 'k'
   78 |             auto it = upper_bound(b[j].vr.begin(),b[j].vr.end(),seg[i].l+seg[i].k-2);
      |                                                                                 ^
segments.cpp:83:77: error: 'struct segment' has no member named 'k'
   83 |                 if(seg[g].r-seg[g].l+1<qs[i].k || seg[g].l>=seg[i].r-seg[i].k+2 || seg[g].r<=seg[i].l+seg[i].k-2) ans--;
      |                                                                             ^
segments.cpp:83:110: error: 'struct segment' has no member named 'k'
   83 |                 if(seg[g].r-seg[g].l+1<qs[i].k || seg[g].l>=seg[i].r-seg[i].k+2 || seg[g].r<=seg[i].l+seg[i].k-2) ans--;
      |                                                                                                              ^
segments.cpp:96:23: error: 'v' was not declared in this scope
   96 | auto it = lower_bound(v.begin(),v.end(),4);
      |                       ^
segments.cpp:32:10: warning: unused variable 'l' [-Wunused-variable]
   32 | int i,qt,l,r,id,k,ans,f=0;
      |          ^
segments.cpp:32:12: warning: unused variable 'r' [-Wunused-variable]
   32 | int i,qt,l,r,id,k,ans,f=0;
      |            ^
segments.cpp:32:14: warning: unused variable 'id' [-Wunused-variable]
   32 | int i,qt,l,r,id,k,ans,f=0;
      |              ^~
segments.cpp:32:17: warning: unused variable 'k' [-Wunused-variable]
   32 | int i,qt,l,r,id,k,ans,f=0;
      |                 ^