Submission #144811

#TimeUsernameProblemLanguageResultExecution timeMemory
144811cfalasVision Program (IOI19_vision)C++14
33 / 100
4 ms1144 KiB
#include "vision.h"
#include<bits/stdc++.h>
using namespace std;

void construct_network(int H, int W, int K) {
			std::vector<int> Ns;
	for(int x1=0;x1<W;x1++){
		for(int y1=0;y1<H;y1++){
			//cout<<endl<<x1+W*y1<<": \n";
			vector<int> a(2);
			a[0] = (y1*W + x1);
			int origx=K+x1, origy=y1;
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					a[1] = origy*W+origx;
					Ns.push_back(add_and(a));
				}
				origy++;
				origx--;
			}
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					a[1] = origy*W+origx;
					Ns.push_back(add_and(a));
				}
				origy--;
				origx--;
			}
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					a[1] = origy*W+origx;
					Ns.push_back(add_and(a));
				}
				origy--;
				origx++;
			}
			for(int i=0;i<K;i++){
				//cout<<origx+origy*W<<" ";
				if(origx<W && origx>=0 && origy<H && origy>=0){
					a[1] = origy*W+origx;
					Ns.push_back(add_and(a));
				}
				origy++;
				origx++;
			}
		}
	}
	int a = add_or(Ns);
}

Compilation message (stderr)

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:51:6: warning: unused variable 'a' [-Wunused-variable]
  int a = add_or(Ns);
      ^
#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...