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;
#define ll long long
#define pb push_back
typedef pair<ll,ll>pii;
const ll MAXN = 9500;
const ll INF = 1e9+7;
void construct_network(int H, int W, int K){
vector<int>Ns,fina;
int d,x,y,a,i,cur,cur1;
if(H==1){
for(i=0;i+K<W;i++){
Ns = {i,i+K};
d = add_and(Ns);
fina.pb(d);
}
add_or(fina);
return;
}else if(W==1){
for(i=0;i+K<H;i++){
Ns = {i,i+K};
d = add_and(Ns);
fina.pb(d);
}
add_or(fina);
return;
}
for(x=0;x<H;x++){
for(y=0;y<W;y++){
cur = x*W + y;
for(i=0;i<=K;i++){
a = K-i+x;
if(i+y<W&&a<H){
cur1 = a*W + y+i;
Ns = {cur,cur1};
d = add_and(Ns);
fina.pb(d);
}
if(y-i>=0&&a<H){
cur1 = a*W + y-i;
Ns = {cur,cur1};
d = add_and(Ns);
fina.pb(d);
}
}
}
}
add_or(fina);
}
# | 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... |