Submission #165929

# Submission time Handle Problem Language Result Execution time Memory
165929 2019-11-29T16:41:33 Z keta_tsimakuridze Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>

#include "vision.h"
using namespace std;
vector<int>V;
int ans(){
	return add_or(V);
}
void construct_network(int h, int w, int K){
	vector<int> Dr[405],Dl[405];
	int cur,diag[405],d[450],a,b,k;
	for(int i=0;i<w;i++)
	for(int j=0;j<h;j++){
		Dr[i-j+h-1].push_back(i*w+j);
	}
	
	
	for(int i=0;i<w;i++)
	for(int j=0;j<h;j++){
		Dl[i+j].push_back(i*w+j);
	}
	
	
	
	
	for(int i=w+h-1;i>=0;i--){
		
		
		diag[i]=add_or(add_or(Dr[i]),diag[i+1]);
		b=0;
		if(i+k<=w+h-1){
			
			a=add_and(diag[i+k],add_or(Dr[i]););
			
			
		}
		if(i+k<=w+h-2)
		b=add_and(diag[i+k+1],add_or(Dr[i]););
		
		V.push_back(add_xor(b,a));
		
		
	}
	
	
	
		for(int i=0;i<=w+h-1;i++){
		
		cur=add_or(Dl[i]);
		
		d[i]=add_or(cur,d[max(0,i-1)]);
		b=0;
		if(i-k>=0){
			
			a=add_and(d[i-k],cur);
			
			
		}
		if(i-k-1>=0)
		b=add_and(d[i-k-1],cur);
		
		V.push_back(add_xor(b,a));
		
		
	}
	
	ans();
	
	
	
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:30:24: error: could not convert 'add_or(std::vector<int>(Dr[i]))' from 'int' to 'std::vector<int>'
   diag[i]=add_or(add_or(Dr[i]),diag[i+1]);
                  ~~~~~~^~~~~~~
vision.cpp:34:37: error: expected ')' before ';' token
    a=add_and(diag[i+k],add_or(Dr[i]););
                                     ^
vision.cpp:34:38: error: expected primary-expression before ')' token
    a=add_and(diag[i+k],add_or(Dr[i]););
                                      ^
vision.cpp:39:38: error: expected ')' before ';' token
   b=add_and(diag[i+k+1],add_or(Dr[i]););
                                      ^
vision.cpp:38:3: warning: this 'if' clause does not guard... [-Wmisleading-indentation]
   if(i+k<=w+h-2)
   ^~
vision.cpp:39:39: note: ...this statement, but the latter is misleadingly indented as if it were guarded by the 'if'
   b=add_and(diag[i+k+1],add_or(Dr[i]););
                                       ^
vision.cpp:39:39: error: expected primary-expression before ')' token
vision.cpp:41:26: error: could not convert 'b' from 'int' to 'std::vector<int>'
   V.push_back(add_xor(b,a));
                          ^
vision.cpp:52:32: error: could not convert 'cur' from 'int' to 'std::vector<int>'
   d[i]=add_or(cur,d[max(0,i-1)]);
                                ^
vision.cpp:56:19: error: could not convert 'd[(i - k)]' from 'int' to 'std::vector<int>'
    a=add_and(d[i-k],cur);
              ~~~~~^
vision.cpp:61:20: error: could not convert 'd[((i - k) - 1)]' from 'int' to 'std::vector<int>'
   b=add_and(d[i-k-1],cur);
             ~~~~~~~^
vision.cpp:63:26: error: could not convert 'b' from 'int' to 'std::vector<int>'
   V.push_back(add_xor(b,a));
                          ^