답안 #166203

# 제출 시각 아이디 문제 언어 결과 실행 시간 메모리
166203 2019-12-01T07:00:42 Z keta_tsimakuridze Vision Program (IOI19_vision) C++14
컴파일 오류
0 ms 0 KB
#include<bits/stdc++.h>
using namespace std;
#include "vision.h"
int j,i,iL[500],iR[500],bR[500],bL[500];
vector<int> ansVec,V,Dr[500],Dl[500];
int getans(int h,int w,int k){


 for(int i=k;i<w+h-1;i++){
 	V.push_back(bL[i-k]);
	V.push_back(iL[i]);
	ansVec.push_back(add_and(V));
	V.clear(); 
	V.push_back(bR[i-k]);
	V.push_back(iR[i]);
	ansVec.push_back(add_and(V));
	V.clear();
	
 }
 return add_or(ansVec);
	
}
void construct_network(int H,int W,int K){
	
	for(i=0;i<H;i++)
	for(j=0;j<W;j++){
		Dr[i-j+W-1].push_back(i*W+j);
		Dl[i+j].push_back(i*W+j);
	}
	iL[0]=add_or(Dl[0]);
	iR[0]=add_or(Dr[0]);
	bL[0]=add_or(Dl[0]);
	bR[0]=add_or(DR[0]);
	for(i=1;i<h+w-1;i++){
	iL[i]=add_or(Dl[i]);
	iR[i]=add_or(Dr[i]);
	V.push_back(iL[i],bL[i-1]);
	bL[i]=add_or(V);
	V.clear();
	V.push_back(iR[i],bR[i-1]);
	bR[i]=add_or(V);
	V.clear;	
		
	} 
	
	
	ans1=getans(H,W,K);
	if(k<=W+H-2){
	
	ans2=getans(H,W,K+1);
	V.push_back(ans1);
	V.push_back(ans2);
	add_xor(V);
	
}

}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:33:15: error: 'DR' was not declared in this scope
  bR[0]=add_or(DR[0]);
               ^~
vision.cpp:33:15: note: suggested alternative: 'Dl'
  bR[0]=add_or(DR[0]);
               ^~
               Dl
vision.cpp:34:12: error: 'h' was not declared in this scope
  for(i=1;i<h+w-1;i++){
            ^
vision.cpp:34:14: error: 'w' was not declared in this scope
  for(i=1;i<h+w-1;i++){
              ^
vision.cpp:37:27: error: no matching function for call to 'std::vector<int>::push_back(int&, int&)'
  V.push_back(iL[i],bL[i-1]);
                           ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
                 from vision.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:939:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:953:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:953:7: note:   candidate expects 1 argument, 2 provided
vision.cpp:40:27: error: no matching function for call to 'std::vector<int>::push_back(int&, int&)'
  V.push_back(iR[i],bR[i-1]);
                           ^
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
                 from vision.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:939:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]
       push_back(const value_type& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:939:7: note:   candidate expects 1 argument, 2 provided
/usr/include/c++/7/bits/stl_vector.h:953:7: note: candidate: void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = int; _Alloc = std::allocator<int>; std::vector<_Tp, _Alloc>::value_type = int]
       push_back(value_type&& __x)
       ^~~~~~~~~
/usr/include/c++/7/bits/stl_vector.h:953:7: note:   candidate expects 1 argument, 2 provided
vision.cpp:42:4: error: invalid use of non-static member function 'void std::vector<_Tp, _Alloc>::clear() [with _Tp = int; _Alloc = std::allocator<int>]'
  V.clear; 
  ~~^~~~~
In file included from /usr/include/c++/7/vector:64:0,
                 from /usr/include/c++/7/queue:61,
                 from /usr/include/x86_64-linux-gnu/c++/7/bits/stdc++.h:86,
                 from vision.cpp:1:
/usr/include/c++/7/bits/stl_vector.h:1247:7: note: declared here
       clear() _GLIBCXX_NOEXCEPT
       ^~~~~
vision.cpp:47:2: error: 'ans1' was not declared in this scope
  ans1=getans(H,W,K);
  ^~~~
vision.cpp:47:2: note: suggested alternative: 'abs'
  ans1=getans(H,W,K);
  ^~~~
  abs
vision.cpp:48:5: error: 'k' was not declared in this scope
  if(k<=W+H-2){
     ^
vision.cpp:50:2: error: 'ans2' was not declared in this scope
  ans2=getans(H,W,K+1);
  ^~~~
vision.cpp:50:2: note: suggested alternative: 'abs'
  ans2=getans(H,W,K+1);
  ^~~~
  abs