이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pb push_back
#define ln '\n'
void construct_network(int h, int w, int k) {
auto f = [&](int k){
auto calc = [&](auto mp){
vector <int> a;
for ( auto &[it, v]: mp ){
a.pb(add_or(v));
}
int n = a.size();
vector <int> pf(n);
pf[0] = a[0];
for ( int i = 1; i < n; i++ ){
pf[i] = add_or({pf[i - 1], a[i]});
}
vector <int> id;
for ( int i = k; i < (int)a.size(); i++ ){
id.pb(add_and({a[i], pf[i - k]}));
}
return add_or(id);
};
int x = -1, y = -1;
{ // i + j diagonal
map <int,vector<int>> mp;
for ( int i = 0; i < h; i++ ){
for ( int j = 0; j < w; j++ ){
mp[i + j].pb(i * w + j);
}
}
x = calc(mp);
}
{
map <int,vector<int>> mp;
for ( int i = 0; i < h; i++ ){
for ( int j = 0; j < w; j++ ){
mp[i - j].pb(i * w + j);
}
}
y = calc(mp);
}
return add_or({x, y});
};
if ( k == h + w - 2 ){
f(k);
} else{
add_and({f(k), add_not(f(k + 1))});
}
}
# | 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... |