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 "vision.h"
#include<bits/stdc++.h>
using namespace std;
int dis(int i,int j,int x,int y){
return (abs(i-x)+abs(j-y));
}
vector<int>v;
map<pair<pair<int,int>,pair<int,int>>,int>mp;
void construct_network(int H, int W, int K) {
for(int i=0;i<H;i++){
for(int j=0;j<W;j++){
for(int i2=0;i2<H;i2++){
for(int j2=0;j2<W;j2++){
if(mp[{{i,j},{i2,j2}}]||mp[{{i2,j2},{i,j}}])continue;
mp[{{i,j},{i2,j2}}]++;
mp[{{i2,j2},{i,j}}]++;
if(dis(i,j,i2,j2)==K){
v.push_back(add_and({i*W+j,i2*W+j2}));
}
}
}
}
}
add_or(v);
}
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |
# | Verdict | Execution time | Memory | Grader output |
---|
Fetching results... |