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 h,w;
int getPos(int x,int y){
return x*w+y;
}
int getDis(pair<int,int> p1,pair<int,int> p2){
return abs(p1.first-p2.first)+abs(p1.second-p2.second);
}
void construct_network(int H, int W, int k) {
h=H,w=W;
vector<int> vec;
for(int i=0;i<h;i++)
for(int j=0;j<w;j++)
for(int p=0;p<h;p++)
for(int q=0;q<w;q++){
if(getDis({i,j},{p,q})==k)
vec.push_back(add_and((vector<int>){getPos(i,j),getPos(p,q)}));
}
add_or(vec);
}
# | 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... |