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 lp(i,a,b) for(int i = a; i < b ; i++)
#define ff first
#define ss second
#define pb push_back
#define ll long long
#define mk make_pair
#define sz(x) (int)(x.size())
#define pii pair<int,int>
#define mkt make_tuple
#define debug printf
#include "vision.h"
using namespace std ;
int N, M ;
int code(int i, int j) { return i * M + j ; }
void construct_network(int H, int W, int K)
{
N = H ;
M = W ;
int lastIdx = H*W - 1 ;
vector<int> v ;
for(int i = 0 ; i < H ; i++ )
for(int j = 0 ; j < W ; j++ )
for(int ii = i; ii < H ; ii++ )
for(int jj = 0 ; jj < W ; jj++ )
if( abs(i-ii) + abs(j-jj) == K )
{
v = { code(i,j) , code(ii,jj) } ;
lastIdx = add_and(v) ;
}
v = {H*W, lastIdx } ;
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... |