Submission #429500

# Submission time Handle Problem Language Result Execution time Memory
429500 2021-06-16T04:17:45 Z lakshith_ Vision Program (IOI19_vision) C++14
0 / 100
21 ms 2300 KB
#include "vision.h"
#include <bits/stdc++.h>

#define checker(a) cout << "checker reached " << a << "\n"

using namespace std;

int h,w;

int getPos(int x,int y){
	return x*w+y;
}

int getDis(pair<int,int> p1,pair<int,int> p2){
	return abs(p1.first-p2.first)+abs(p1.second-p2.second);
}

void construct_network(int H, int W, int k) {
	h=H,w=W;
	vector<vector<int>> ro,col;
	for(int i=0;i<h;i++){
		ro.push_back(vector<int>());
		for(int j=0;j<w;j++)
			ro[i].push_back(getPos(i,j));
	}
	for(int i=0;i<w;i++){
		col.push_back(vector<int>());
		for(int j=0;j<h;j++)
			col[i].push_back(getPos(j,i));
	}
	
	vector<int> Xor;
	for(vector<int> vec:ro)
		Xor.push_back(add_xor(vec));
	for(vector<int> vec:col)
		Xor.push_back(add_xor(vec));
	
	vector<int> Not;
	for(int a:Xor)
		Not.push_back(add_not(a));
	Xor.clear();
	
	vector<int> Or,close;
	for(vector<int> vec:ro)
		Or.push_back(add_or(vec));
	for(size_t i=0;i<h-1;i++){
		close.push_back(add_and((vector<int>){Or[i],Or[i+1]}));
	}
	for(size_t i=h;i<Or.size()-1;i++){
		close.push_back(add_and((vector<int>){Or[i],Or[i+1]}));
	}

	for(vector<int> vec:col)
		Or.push_back(add_or(vec));
	
	vector<int> And;
	for(size_t i=0;i<Or.size();i++)
		And.push_back(add_and((vector<int>){Or[i],Not[i]}));
		
	int p1 = add_or(And);
	int p2 = add_or(close);
	add_and((vector<int>){p1,p2});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:46:18: warning: comparison of integer expressions of different signedness: 'size_t' {aka 'long unsigned int'} and 'int' [-Wsign-compare]
   46 |  for(size_t i=0;i<h-1;i++){
      |                 ~^~~~
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 332 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
2 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Correct 21 ms 2300 KB Output is correct
2 Incorrect 1 ms 204 KB on inputs (0, 0), (0, 1), expected 1, but computed 0
3 Halted 0 ms 0 KB -
# Verdict Execution time Memory Grader output
1 Incorrect 1 ms 204 KB WA in grader: Instruction with no inputs
2 Halted 0 ms 0 KB -