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 pb push_back
int h;
int w;
bool valid(int y, int x)
{
if(y>=0 && x>=0 && y<h && x<w)
{
return 1;
}
return 0;
}
void construct_network(int H, int W, int K)
{
bool flag=0;
int last;
vector <int> fnl;
h=H;
w=W;
if(h*w>1000)
{
flag=1;
}
for(int i=0;i<h;i++)
{
for(int j=0;j<w;j++)
{
vector <int> nums;
for(int k=0;k<K;k++)
{
int y=i+K-k;
int x=j+k;
if(valid(y,x))
{
nums.pb((y*w+x));
}
y=i-k;
x=j+K-k;
if(valid(y,x))
{
nums.pb((y*w+x));
}
y=i-K+k;
x=j-k;
if(valid(y,x))
{
nums.pb((y*w+x));
}
y=i+k;
x=j-K+k;
if(valid(y,x))
{
nums.pb((y*w+x));
}
}
if(nums.size())
{
last=add_or(nums);
last=add_and({last,i*w+j});
fnl.pb(last);
}
if(flag)
{
return;
}
}
}
/*printf("\n\n");
for(int i=0;i<fnl.size();i++)
{
printf("%d ",fnl[i]);
}
printf("\n");*/
add_or(fnl);
}
# | 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... |