Submission #442209

#TimeUsernameProblemLanguageResultExecution timeMemory
442209peijarVision Program (IOI19_vision)C++17
32 / 100
15 ms4688 KiB
#include "vision.h" #include <bits/stdc++.h> using namespace std; /* * Subtask 1 - 2 - 3 - 5 - 6 - 7 : AC = 66 * Subtask 4 8 */ void construct_network(int nbLig, int nbCol, int K) { int maxDeltaLig = nbLig - 1; vector<int> avecDeltaLig(maxDeltaLig + 1); // 2 sur meme lig ? vector<int> sameLig; for (int lig = 0; lig < nbLig; ++lig) { vector<int> pos; for (int col = 0; col < nbCol; ++col) pos.push_back(col + nbCol * lig); sameLig.push_back(add_and({add_or(pos), add_not(add_xor(pos))})); } avecDeltaLig[0] = add_or(sameLig); vector<int> before; before.push_back(avecDeltaLig[0]); for (int deltaLig = maxDeltaLig; deltaLig; --deltaLig) { vector<int> toAsk; for (int residu = 0; residu < deltaLig; ++residu) { vector<int> cases; for (int lig = residu; lig < nbLig; lig += deltaLig) for (int col = 0; col < nbCol; ++col) cases.push_back(lig * nbCol + col); toAsk.push_back(add_and({add_or(cases), add_not(add_xor(cases))})); } int withMult = add_or(toAsk); avecDeltaLig[deltaLig] = add_and({withMult, add_not(add_or(before))}); before.push_back(avecDeltaLig[deltaLig]); } int maxDeltaCol = nbCol - 1; vector<int> avecDeltaCol(maxDeltaCol + 1); vector<int> sameCol; for (int col = 0; col < nbCol; ++col) { vector<int> pos; for (int lig = 0; lig < nbLig; ++lig) pos.push_back(col + nbCol * lig); sameCol.push_back(add_and({add_or(pos), add_not(add_xor(pos))})); } avecDeltaCol[0] = add_or(sameCol); before.clear(); before.push_back(avecDeltaCol[0]); for (int deltaCol = maxDeltaCol; deltaCol; --deltaCol) { vector<int> toAsk; for (int residu = 0; residu < deltaCol; ++residu) { vector<int> cases; for (int col = residu; col < nbCol; col += deltaCol) for (int lig = 0; lig < nbLig; ++lig) cases.push_back(col + nbCol * lig); toAsk.push_back(add_and({add_or(cases), add_not(add_xor(cases))})); } int withMult = add_or(toAsk); avecDeltaCol[deltaCol] = add_and({withMult, add_not(add_or(before))}); before.push_back(avecDeltaCol[deltaCol]); } vector<int> q; for (int dL = 0; dL <= maxDeltaLig; ++dL) { int dC = K - dL; if (dC >= 0 and dC <= maxDeltaCol) q.push_back(add_and({avecDeltaCol[dC], avecDeltaLig[dL]})); } add_or(q); }
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...
#Verdict Execution timeMemoryGrader output
Fetching results...