이 제출은 이전 버전의 oj.uz에서 채점하였습니다. 현재는 제출 당시와는 다른 서버에서 채점을 하기 때문에, 다시 제출하면 결과가 달라질 수도 있습니다.
#include "vision.h"
#include <bits/stdc++.h>
using namespace std;
#define pf printf
#define pb push_back
vector<int> qry,qry2;
int l[405],r[405];
int add_and(int a,int b){
vector<int> v{a,b};
return add_and(v);
}
int add_or(int a,int b){
vector<int> v{a,b};
return add_or(v);
}
void construct_network(int H,int W,int K){
for(int i=0;i<H+W-1;++i){
for(int h=0;h<H;++h){
if(h+W-1<i)continue;
qry.pb(h*W+(i-h));
}
l[i]=add_xor(qry);
qry.clear();
}
for(int i=0;i<H+W-1;++i){//h-w=i-(W-1)
for(int h=0;h<H;++h){
if(h-i>0||h-i<=-W)continue;
qry.pb(h*W+(h-i+W-1));
}
r[i]=add_xor(qry);
qry.clear();
}
int la,lb,ra,rb;
for(int i=0;i<H+W-2;++i){
for(int j=i+1;j<=i+K;++j)qry.pb(l[j]);
qry2.pb(add_and(l[i],add_or(qry)));
qry.clear();
}
la=add_or(qry2);
qry2.clear();
if(K!=1){
for(int i=0;i<H+W-2;++i){
for(int j=i+1;j<=i+K-1;++j)qry.pb(l[j]);
qry2.pb(add_and(l[i],add_or(qry)));
qry.clear();
}
lb=add_or(qry2);
qry2.clear();
}
else{
for(int i=0;i<H+W-1;++i)qry.pb(l[i]);
lb=add_not(add_or(qry));
}
for(int i=0;i<H+W-2;++i){
for(int j=i+1;j<=i+K;++j)qry.pb(r[j]);
qry2.pb(add_and(r[i],add_or(qry)));
qry.clear();
}
ra=add_or(qry2);
qry2.clear();
if(K!=1){
for(int i=0;i<H+W-2;++i){
for(int j=i+1;j<=i+K-1;++j)qry.pb(r[j]);
qry2.pb(add_and(r[i],add_or(qry)));
qry.clear();
}
rb=add_or(qry2);
qry2.clear();
}
else{
for(int i=0;i<H+W-1;++i)qry.pb(r[i]);
rb=add_not(add_or(qry));
}
add_and(add_and(la,ra),add_or(add_not(lb),add_not(rb)));
//add_or(add_and(la,add_not(lb)),add_and(ra,add_not(rb)));
}
# | 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... |