#include <bits/stdc++.h>
using namespace std;
const int M=1000001,P=400001;
int m,n,b,p,x[P],y[P],u[P],v[P],c[P];
unsigned int st[M*4],sum[M*4];
vector <int> ve[M+1];
void update(int node, int l, int r, int u, int v, int val){
if (l>v||r<u)
return;
if (l>=u&&r<=v){
st[node]+=val;
sum[node]+=val;
return;
}
int mid=(l+r)>>1;
update(node<<1,l,mid,u,v,val);
update(node<<1|1,mid+1,r,u,v,val);
st[node]=min(st[node<<1],st[node<<1|1])+sum[node];
}
bool check(int sz){
for (int i=1;i<=m+1;i++)
ve[i].clear();
for (int i=1;i<=n*4;i++)
st[i]=sum[i]=0;
for (int i=1;i<=p;i++){
int X=max(x[i]-sz+1,1);
ve[X].push_back(i);
ve[u[i]+1].push_back(-i);
}
return false;
}
int main(){
ios_base::sync_with_stdio(NULL);cin.tie(nullptr);
cin >> m >> n >> b >> p;
for (int i=1;i<=p;i++)
cin >> x[i] >> y[i] >> u[i] >> v[i] >> c[i];
int l=1,r=min(m,n),kq=0;
while (l<=r){
int mid=(l+r)>>1;
if (check(mid)){
kq=mid;
l=mid+1;
}
else
r=mid-1;
}
cout << kq;
}
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
35420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
35420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
35420 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
11 ms |
37720 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
16 ms |
40028 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
138 ms |
62492 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
136 ms |
62528 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
14 ms |
37904 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
32 ms |
42332 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
284 ms |
72112 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
301 ms |
74048 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
324 ms |
75872 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
776 ms |
93060 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1039 ms |
94652 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |
# |
Verdict |
Execution time |
Memory |
Grader output |
1 |
Incorrect |
1246 ms |
95444 KB |
Output isn't correct |
2 |
Halted |
0 ms |
0 KB |
- |