Submission #267071

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
2670712020-08-15 19:02:35ChrisTInterval Collection (CCO20_day2problem2)C++17
25 / 25
3731 ms294796 KiB
#include<bits/stdc++.h>
using namespace std;
using ll = long long;
using pii = pair<int,int>;
using pll = pair<ll,ll>;
using pli = pair<ll,int>;
using ld = long double;
#define all(x) (x).begin(),(x).end()
const int MN = 5e5 + 5, MOD = 1e9 + 7, BASE = 131;
pii inter[MN];
map<int,vector<int>> ou[MN<<1];
struct Seg {
int t,t2,l,r,push;
};
int ans[MN]; pii isect[MN];
void cdq (int l, int r, vector<Seg> &lsrt, vector<Seg> &rsrt, int push, pii inter) {
int mid = (l+r)/2;
vector<Seg> lq,rq,llq,rrq;
int pp = 0, sz = rsrt.size(), mxl = -1e9;
for (Seg &s : lsrt) {
while (pp<sz&&rsrt[pp].r<=s.l) {
if (rsrt[pp].t <= l && r <= rsrt[pp].t2) mxl = max(mxl,rsrt[pp].l);
++pp;
}
if (s.t <= l && r <= s.t2) {
inter.first = max(inter.first,s.l); inter.second = min(inter.second,s.r);
push = min(push,s.r - mxl);
push = min(push,s.push);
} else {
s.push = min(s.push,s.r - mxl);
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX

Compilation message (stderr)

Main.cpp: In function 'int main()':
Main.cpp:61:8: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   61 |  scanf ("%d",&q);
      |  ~~~~~~^~~~~~~~~
Main.cpp:65:9: warning: ignoring return value of 'int scanf(const char*, ...)', declared with attribute warn_unused_result [-Wunused-result]
   65 |   scanf (" %c %d %d",&c,&l,&r);
      |   ~~~~~~^~~~~~~~~~~~~~~~~~~~~~
#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...