Submission #144235

#TimeUTC-0UsernameProblemLanguageResultExecution timeMemory
1442352019-08-16 10:57:18icypiggyVision Program (IOI19_vision)C++14
100 / 100
29 ms3452 KiB
#include "vision.h"
#include <vector>
using namespace std;
void construct_network(int H, int W, int K) {
if(K==H+W-2) {
add_or({add_and({0,H*W-1}),add_and({W-1,(H-1)*W})});
return;
}
vector<int> vdiag[H+W-1];
vector<int> vdiag2[H+W-1];
int idx_diag[H+W-1];
int idx_diag2[H+W-1];
for(int i=0; i<H; i++) {
for(int j=0; j<W; j++) {
vdiag[i+j].push_back(i*W+j);
vdiag2[H-1-i+j].push_back(i*W+j);
//cout << "vdiag: " << i*W+j << " " << i+j << " " << H-1-i+j << "\n";
}
}
for(int i=0; i<H+W-1; i++) {
idx_diag[i] = add_or(vdiag[i]);
}
for(int i=0; i<H+W-1; i++) {
idx_diag2[i] = add_or(vdiag2[i]);
}
vector<int> tmp;
for(int i=0; i+K<H+W-1; i++) {
tmp.push_back(add_and({idx_diag[i], idx_diag[i+K]}));
tmp.push_back(add_and({idx_diag2[i], idx_diag2[i+K]}));
 
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
#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...