답안 #1031520

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
1031520 2024-07-22T23:24:36 Z Marco_Escandon Vision Program (IOI19_vision) C++17
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
typedef int ll;
void construct_network(int H, int W, int K) {
	vector<ll> ia, da;
	for(int i=0; i<W; i++)
	{
		vector<ll> temp;
		for(int j=0; j<=min(i,H-1); j++)
			temp.push_back((i-j)+(W*j));
		ia.push_back(add_or(temp));
	}
	for(int i=1; i<H; i++)
	{
		vector<ll> temp;
		for(int j=0; j<W; j++)
			if(j+i<H)
				temp.push_back((W-j-1)+(W*(j+i)));
		ia.push_back(add_or(temp));
	}
 
	for(int i=W-1; i>-1; i--)
	{
		vector<ll> temp;
		for(int j=0; j<=min(H-1,W-i-1); j++)
		{
			temp.push_back((i+j)+(W*j));
		}
		da.push_back(add_or(temp));
	}
	for(int i=1; i<H; i++)
	{
		vector<ll> temp;
		for(int j=0; j+i<W; j++)
			if(j+i<H)
				temp.push_back(j+(W*(j+i)));
		da.push_back(add_or(temp));
	}
	vector<ll> asd1;
	for(int i=0; i<ia.size()-K; i++)
	{
		vector<int> sub_vector(ia.begin() + i, ia.begin() + i+K+1);
		ll a=add_xor(sub_vector);
		ll b=add_not(a);
		ll c=add_or(sub_vector);
		asd1.push_back(add_and({b,c}));
	}
	vector<ll> asd2;
	for(int i=0; i<da.size()-K; i++)
	{
		vector<int> sub_vector(da.begin() + i, da.begin() + i+K+1);
		ll a=add_xor(sub_vector);
		ll b=add_not(a);
		ll c=add_or(sub_vector);
		asd2.push_back(add_and({b,c}));
	}
	ll bsk_1=add_and({add_or(asd1),add_or(asd2)});
	asd1.clear();
	for(int i=0; i<ia.size()-K+1; i++)
	{
		vector<int> sub_vector(ia.begin() + i, ia.begin() + i+K);
		ll a=add_xor(sub_vector);
		ll b=add_not(a);
		ll c=add_or(sub_vector);
		asd1.push_back(add_and({b,c}));
	}
	asd2.clear();
	for(int i=0; i<da.size()-K+1; i++)
	{
		vector<int> sub_vector(da.begin() + i, da.begin() + i+K);
		ll a=add_xor(sub_vector);
		ll b=add_not(a);
		ll c=add_or(sub_vector);
		asd2.push_back(add_and({b,c}));
	}
	ll bsk_2=add_and({add_or(asd1),add_or(asd2)});
	ll ans=add_and({bsk_1,add_not(bsk_2)});
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:11:16: error: 'add_or' was not declared in this scope
   11 |   ia.push_back(add_or(temp));
      |                ^~~~~~
vision.cpp:19:16: error: 'add_or' was not declared in this scope
   19 |   ia.push_back(add_or(temp));
      |                ^~~~~~
vision.cpp:29:16: error: 'add_or' was not declared in this scope
   29 |   da.push_back(add_or(temp));
      |                ^~~~~~
vision.cpp:37:16: error: 'add_or' was not declared in this scope
   37 |   da.push_back(add_or(temp));
      |                ^~~~~~
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<ia.size()-K; i++)
      |               ~^~~~~~~~~~~~
vision.cpp:43:8: error: 'add_xor' was not declared in this scope
   43 |   ll a=add_xor(sub_vector);
      |        ^~~~~~~
vision.cpp:44:8: error: 'add_not' was not declared in this scope
   44 |   ll b=add_not(a);
      |        ^~~~~~~
vision.cpp:45:8: error: 'add_or' was not declared in this scope
   45 |   ll c=add_or(sub_vector);
      |        ^~~~~~
vision.cpp:46:18: error: 'add_and' was not declared in this scope
   46 |   asd1.push_back(add_and({b,c}));
      |                  ^~~~~~~
vision.cpp:49:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   49 |  for(int i=0; i<da.size()-K; i++)
      |               ~^~~~~~~~~~~~
vision.cpp:52:8: error: 'add_xor' was not declared in this scope
   52 |   ll a=add_xor(sub_vector);
      |        ^~~~~~~
vision.cpp:53:8: error: 'add_not' was not declared in this scope
   53 |   ll b=add_not(a);
      |        ^~~~~~~
vision.cpp:54:8: error: 'add_or' was not declared in this scope
   54 |   ll c=add_or(sub_vector);
      |        ^~~~~~
vision.cpp:55:18: error: 'add_and' was not declared in this scope
   55 |   asd2.push_back(add_and({b,c}));
      |                  ^~~~~~~
vision.cpp:57:20: error: 'add_or' was not declared in this scope
   57 |  ll bsk_1=add_and({add_or(asd1),add_or(asd2)});
      |                    ^~~~~~
vision.cpp:57:11: error: 'add_and' was not declared in this scope
   57 |  ll bsk_1=add_and({add_or(asd1),add_or(asd2)});
      |           ^~~~~~~
vision.cpp:59:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   59 |  for(int i=0; i<ia.size()-K+1; i++)
      |               ~^~~~~~~~~~~~~~
vision.cpp:62:8: error: 'add_xor' was not declared in this scope
   62 |   ll a=add_xor(sub_vector);
      |        ^~~~~~~
vision.cpp:63:8: error: 'add_not' was not declared in this scope
   63 |   ll b=add_not(a);
      |        ^~~~~~~
vision.cpp:68:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
   68 |  for(int i=0; i<da.size()-K+1; i++)
      |               ~^~~~~~~~~~~~~~
vision.cpp:71:8: error: 'add_xor' was not declared in this scope
   71 |   ll a=add_xor(sub_vector);
      |        ^~~~~~~
vision.cpp:72:8: error: 'add_not' was not declared in this scope
   72 |   ll b=add_not(a);
      |        ^~~~~~~
vision.cpp:77:24: error: 'add_not' was not declared in this scope
   77 |  ll ans=add_and({bsk_1,add_not(bsk_2)});
      |                        ^~~~~~~
vision.cpp:77:5: warning: unused variable 'ans' [-Wunused-variable]
   77 |  ll ans=add_and({bsk_1,add_not(bsk_2)});
      |     ^~~