이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#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... |