Submission #293404

# Submission time Handle Problem Language Result Execution time Memory
293404 2020-09-08T03:26:41 Z Dovran Vision Program (IOI19_vision) C++14
Compilation error
0 ms 0 KB
#include <bits/stdc++.h>
#define N 100009
#define pii pair <int, int>
#define ff first
#define ss second
#define sz size
#define pb push_back
#define ll long long

using namespace std;

void construct_network(int n, int m, int k){
	if(k!=1)
	{
		vector<int>e;
		for(int i=0; i<n; i++){
			for(int j=0; j<m; j++){
				if(i+j==k)
					e.pb(i*m+j);
			}
		}
		add_or(e);
		return;
	}
	
	vector<int>a, b, c, d;
	for(int i=0; i<n; i++){
		vector<int>e;
		for(int j=0; j<m; j++)
			e.pb(i*m+j);
		a.pb(add_or(e));
	}
	for(int j=0; j<m; j++){
		vector<int>e;
		for(int i=0; i<n; i++)
			e.pb(i*m+j);
		c.pb(add_or(e));
	}
	
	for(int i=0; i<a.sz()-1; i++)
		b.pb(add_and({a[i], a[i+1]}));
	
	for(int i=0; i<c.sz()-1; i++)
		b.pb(add_and({c[i], c[i+1]}));
	for(auto i:c)
		a.pb(i);
	
		
	int x=add_xor(a);
	int y=add_xor(b);
	add_and({x, y});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:22:3: error: 'add_or' was not declared in this scope
   22 |   add_or(e);
      |   ^~~~~~
vision.cpp:31:8: error: 'add_or' was not declared in this scope
   31 |   a.pb(add_or(e));
      |        ^~~~~~
vision.cpp:37:8: error: 'add_or' was not declared in this scope
   37 |   c.pb(add_or(e));
      |        ^~~~~~
vision.cpp:40:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   40 |  for(int i=0; i<a.sz()-1; i++)
      |               ~^~~~~~~~~
vision.cpp:41:8: error: 'add_and' was not declared in this scope
   41 |   b.pb(add_and({a[i], a[i+1]}));
      |        ^~~~~~~
vision.cpp:43:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   43 |  for(int i=0; i<c.sz()-1; i++)
      |               ~^~~~~~~~~
vision.cpp:44:8: error: 'add_and' was not declared in this scope
   44 |   b.pb(add_and({c[i], c[i+1]}));
      |        ^~~~~~~
vision.cpp:49:8: error: 'add_xor' was not declared in this scope
   49 |  int x=add_xor(a);
      |        ^~~~~~~
vision.cpp:51:2: error: 'add_and' was not declared in this scope
   51 |  add_and({x, y});
      |  ^~~~~~~