This submission is migrated from previous version of oj.uz, which used different machine for grading. This submission may have different result if resubmitted.
#include<bits/stdc++.h>
#include "vision.h"
using namespace std;
int nbLig,nbCol,distObj;
vector<int> listeLig,listeCol,distLig,distCol;
vector<int> calcDist(vector<int> val) {
vector<int> rep,quest;
int taille=val.size();
rep.push_back(add_xor(val));
for (int i=1;i<taille;i++) {
quest.clear();
for (int a=0;a<taille;a++) {
for (int b=a+1;b<taille;b++) {
if (b-a==i) {
quest.push_back(add_and({val[a],val[b]}));
}
}
}
rep.push_back(add_or(quest));
}
return rep;
}
void construct_network(int H, int W, int K) {
nbLig=H;
nbCol=W;
distObj=K;
vector<int> quest;
for (int j=0;j<nbCol;j++) {
quest.clear();
for (int i=0;i<nbLig;i++) {
quest.push_back(i*nbCol+j);
}
listeCol.push_back(add_or(quest));
}
distCol=calcDist(listeCol);
for (int i=0;i<nbLig;i++) {
quest.clear();
for (int j=0;j<nbCol;j++) {
quest.push_back(i*nbCol+j);
}
listeLig.push_back(add_or(quest));
}
distLig=calcDist(listeLig);
quest.clear();
for (int i=0;i<nbLig;i++) {
for (int j=0;j<nbCol;j++) {
if (i+j==distObj) {
quest.push_back(add_and({distLig[i],distCol[j]}));
}
}
}
add_or(quest);
}
# | 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... |