# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
535614 | new_acc | Park (BOI16_park) | C++14 | 1773 ms | 33228 KiB |
This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#define fi first
#define se second
using namespace std;
typedef long long ll;
typedef vector<int> vi;
typedef vector<ll> vl;
const int N=2e3+10;
int mini[5][5],fau[N],n,m,w,h,c[N];
pair<int,int> z[N];
ll odl[N][N];
int Find(int a){
if(fau[a]==a) return a;
return fau[a]=Find(fau[a]);
}
void Union(int a,int b){
fau[Find(a)]=Find(fau[b]);
}
bool check(int x,int a,int b){
for(int i=1;i<=n+4;i++) fau[i]=i;
for(int i=1;i<=n;i++){
for(int j=1;j<=n;j++){
if(i==j) continue;
if(odl[i][j]<(ll)(x*2+c[i]+c[j])*(ll)(x*2+c[i]+c[j])) Union(i,j);
}
}
for(int i=1;i<=n;i++){
if(z[i].se-c[i]<x*2) Union(i,n+1);
if(w-z[i].fi-c[i]<x*2) Union(i,n+2);
if(h-z[i].se-c[i]<x*2) Union(i,n+3);
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|---|---|---|---|
Fetching results... |