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 n, m;
int getCell(int i, int j) { return i*m + j; }
void construct_network(int H, int W, int K)
{
n = H; m = W;
vector< int > q;
vector< int > all;
int curInd = H*W - 1;
for(int curX = 0 ; curX < n ; curX++)
{
for(int curY = 0 ; curY < m ; curY++)
{
vector< int > q;
for(int x = 0 ; x < n ; x++)
{
for(int y = 0 ; y < m ; y++)
{
int dx = abs( x - curX );
int dy = abs( y - curY );
if( dx + dy == K )
q.push_back( getCell( x , y ) );
}
}
q.push_back( getCell( curX , curY ) );
add_or( q );//curInd + 1
add_xor( q );//curInd + 2
vector< int > aux;
aux.push_back( curInd + 1 );
aux.push_back( curInd + 2 );
add_xor( aux );
all.push_back( curInd + 3 );
curInd += 3;
}
}
add_or( all );
}
# | 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... |