답안 #165927

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
165927 2019-11-29T16:38:23 Z keta_tsimakuridze Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.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--){
		
		cur=add_or(Dr[i]);
		
		diag[i]=add_or(cur,diag[i+1]);
		b=0;
		if(i+k<=w+h-1){
			
			a=add_and(diag[i+k],cur);
			
			
		}
		if(i+k<=w+h-2)
		b=add_and(diag[i+k+1],cur);
		
		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 'int ans()':
vision.cpp:6:9: error: 'add_or' was not declared in this scope
  return add_or(V);
         ^~~~~~
vision.cpp:6:9: note: suggested alternative: 'rand_r'
  return add_or(V);
         ^~~~~~
         rand_r
vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:27:7: error: 'add_or' was not declared in this scope
   cur=add_or(Dr[i]);
       ^~~~~~
vision.cpp:27:7: note: suggested alternative: 'rand_r'
   cur=add_or(Dr[i]);
       ^~~~~~
       rand_r
vision.cpp:33:6: error: 'add_and' was not declared in this scope
    a=add_and(diag[i+k],cur);
      ^~~~~~~
vision.cpp:38:5: error: 'add_and' was not declared in this scope
   b=add_and(diag[i+k+1],cur);
     ^~~~~~~
vision.cpp:40:15: error: 'add_xor' was not declared in this scope
   V.push_back(add_xor(b,a));
               ^~~~~~~
vision.cpp:49:7: error: 'add_or' was not declared in this scope
   cur=add_or(Dl[i]);
       ^~~~~~
vision.cpp:49:7: note: suggested alternative: 'rand_r'
   cur=add_or(Dl[i]);
       ^~~~~~
       rand_r
vision.cpp:55:6: error: 'add_and' was not declared in this scope
    a=add_and(d[i-k],cur);
      ^~~~~~~
vision.cpp:60:5: error: 'add_and' was not declared in this scope
   b=add_and(d[i-k-1],cur);
     ^~~~~~~
vision.cpp:62:15: error: 'add_xor' was not declared in this scope
   V.push_back(add_xor(b,a));
               ^~~~~~~