이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
vector<int> l, r, a, b, c, d, tmp;
void construct_network(int n, int m, int k)
{
for (int i=0; i<=n+m-2; i++)
{
tmp.clear();
for (int j=0; j<n; j++)
if (i-j>=0 && i-j<m)
tmp.push_back(j*m+i-j);
l.push_back(add_or(tmp));
}
for (int i=-n+1; i<=m-1; i++)
{
tmp.clear();
for (int j=0; j<n; j++)
if (i+j>=0 && i+j<m)
tmp.push_back(j*m+i+j);
r.push_back(add_or(tmp));
}
for (int i=0; i<n+m-2; i++)
{
tmp.clear();
for (int j=i+1; j<=min(i+k, n+m-2); j++)
tmp.push_back(l[j]);
int x=add_or(tmp);
tmp.clear();
tmp.push_back(l[i]);
tmp.push_back(x);
a.push_back(add_and(tmp));
if (i+k<=n+m-2)
{
tmp.clear();
tmp.push_back(l[i]);
tmp.push_back(l[i+k]);
b.push_back(add_and(tmp));
}
}
for (int i=0; i<n+m-2; i++)
{
tmp.clear();
for (int j=i+1; j<=min(i+k, n+m-2); j++)
tmp.push_back(r[j]);
int x=add_or(tmp);
tmp.clear();
tmp.push_back(r[i]);
tmp.push_back(x);
c.push_back(add_and(tmp));
if (i+k<=n+m-2)
{
tmp.clear();
tmp.push_back(r[i]);
tmp.push_back(r[i+k]);
d.push_back(add_and(tmp));
}
}
tmp.clear();
tmp.push_back(add_or(a));
tmp.push_back(add_or(d));
int x=add_and(tmp);
tmp.clear();
tmp.push_back(add_or(b));
tmp.push_back(add_or(c));
int y=add_and(tmp);
tmp.clear();
tmp.push_back(x);
tmp.push_back(y);
add_or(tmp);
}
# | 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... |