# | Submission time | Handle | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
979077 | 2024-05-10T07:51:48 Z | WongYiKai | Vision Program (IOI19_vision) | C++14 | 0 ms | 0 KB |
#include "vision.h" #include <bits/stdc++.h> using namespace std; void construct_network(int H, int W, int K) { vector<int> Ns; vector<int> output; int count=0; for (int i=0;i<H*W;i++){ Ns.clear(); int x=K+i%W,y=i/W; //cout << "loop " << x << " " << y << "\n"; while (x>=W){ x--; y++; } while (x>=i%W&&y<H&&y>=0){ //Ns = {i,y*W+x}; //cout << i << " " << y*W+x << "\n"; Ns.push_back(y*W+x); x--; y++; } x=i%W-K; y=i/W; //cout << "loop " << x << " " << y << "\n"; while (x<0){ x++; y++; } while (x<i%W&&y<H&&y>=0){ //Ns = {i,y*W+x}; //cout << i << " " << y*W+x << "\n"; Ns.push_back(y*W+x); x=K+i%W-1,y=i/W-1; //cout << "loop " << x << " " << y << "\n"; while (x>=W){ x--; y--; } while (x>=i%W&&y<H&&y>=0){ //Ns = {i,y*W+x}; //cout << i << " " << y*W+x << "\n"; Ns.push_back(y*W+x); x--; y--; } x=i%W-K+1; y=i/W-1; //cout << "loop " << x << " " << y << "\n"; while (x<0){ x++; y--; } while (x<i%W&&y<H&&y>=0){ //Ns = {i,y*W+x}; //cout << i << " " << y*W+x << "\n"; Ns.push_back(y*W+x); x++; y--; } int c = add_not(i); int d = add_or(Ns); int e = add_or({c,d}); output.push_back(e); count += Ns.size()+3; } int b = add_and(output); count++; //cout << "count " << count << "\n"; return; }