이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
typedef long long ll;
typedef pair<int, int> pii;
typedef vector<int> vi;
void construct_network ( int H, int W, int K )
{
vi rows, cols, ind, auxrow, auxcol, fin;
for ( int i = 0; i < H; i++ )
{
ind.clear();
for ( int j = 0; j < W; j++ )
ind.push_back ( i * W + j );
rows.push_back ( add_or ( ind ) );
}
for ( int j = 0; j < W; j++ )
{
ind.clear();
for ( int i = 0; i < H; i++ )
ind.push_back ( i * W + j );
cols.push_back ( add_or ( ind ) );
}
for ( int i = 1; i < K; i++ )
{
if ( i < H && K - i < W )
{
auxrow.clear(), auxcol.clear();
for ( int x = 0; x + i < H; x++ )
{
ind.clear();
ind.push_back ( rows[x] );
ind.push_back ( rows[x + i] );
auxrow.push_back ( add_and ( ind ) );
}
for ( int x = 0; x + K - i < W; x++ )
{
ind.clear();
ind.push_back ( cols[x] );
ind.push_back ( cols[x + K - i] );
auxcol.push_back ( add_and ( ind ) );
}
ind.clear();
ind.push_back ( add_or ( auxrow ) );
ind.push_back ( add_or ( auxcol ) );
fin.push_back ( add_and ( ind ) );
}
}
add_or ( fin );
}
# | 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... |