이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <iostream>
using namespace std;
#define pb push_back
const int N = 405;
int f(int w[], int x, int k){
vector<int> v;
for(int i = 0; i + k <= x; i++){
vector<int> l, r;
for(int j = 0; j <= i; j++) l.pb(w[j]);
for(int j = i + k; j <= x; j++) r.pb(w[j]);
vector<int> t;
t.pb(add_or(l)); t.pb(add_or(r));
v.push_back(add_and(t));
}
return add_or(v);
}
void construct_network(int H, int W, int K) {
int xpy[N], xmy[N];
vector<int> pv[N], mv[N];
for(int i = 0; i < H; i++) for(int j = 0; j < W; j++){
pv[i + j].pb(i * W + j);
mv[H - 1 - i + j].pb(i * W + j);
}
int X = H + W - 2;
for(int i = 0; i <= X; i++){
xpy[i] = add_or(pv[i]);
xmy[i] = add_or(mv[i]);
}
if(K == X){
int a = f(xpy, X, K);
int b = f(xmy, X, K);
vector<int> v;
v.pb(a); v.pb(b);
add_or(v);
return;
}
int a = f(xpy, X, K);
int A = f(xpy, X, K + 1);
int b = f(xmy, X, K);
int B = f(xmy, X, K + 1);
vector<int> v, t;
t.pb(a); t.pb(b); v.pb(add_or(t));
v.pb(add_not(A));
v.pb(add_not(B));
add_and(v);
}
| # | 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... |