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>
//#include "grader.cpp"
using namespace std;
void construct_network(int H, int W, int K)
{
int cnt=0;
vector<int> v;
for(int is=0;is<H;is++)
for(int js=0;js<W;js++)
for(int ij=is;ij<H&&ij<=is+K;ij++)
{
int need=K-(ij-is);
assert(need>=0);
int jj=js+need;
if(jj<W)
{
v={is*H+js,ij*H+jj};
//cout<<is<<' '<<js<<' '<<ij<<' '<<jj<<'\n';
add_and(v);
cnt++;
}
jj=js-need;
if(jj>=0&&need!=0)
{
v={is*H+js,ij*H+jj};
//cout<<is<<' '<<js<<' '<<ij<<' '<<jj<<'\n';
add_and(v);
cnt++;
}
}
v.clear();
for(int i=H*W;i<H*W+cnt;i++)
v.push_back(i);
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... |