Submission #834779

#TimeUsernameProblemLanguageResultExecution timeMemory
834779oscar1fVision Program (IOI19_vision)C++17
32 / 100
5 ms1232 KiB
#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 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...