Submission #612714

# Submission time Handle Problem Language Result Execution time Memory
612714 2022-07-29T21:45:07 Z morete Vision Program (IOI19_vision) C++17
Compilation error
0 ms 0 KB
#include<bits/stdc++.h>
void construct_network(int H, int W, int K) {
	int ct = 0;
	
		for(int i = 0; i + K < max(W, H); i++){
			add_and({i, i + K});
			ct++;
		}
	vector<int> v;
	for(int i = H*W; i < H*W + ct; i++) v.push_back(i);
	add_or(v);
}

Compilation message

vision.cpp: In function 'void construct_network(int, int, int)':
vision.cpp:5:26: error: 'max' was not declared in this scope; did you mean 'std::max'?
    5 |   for(int i = 0; i + K < max(W, H); i++){
      |                          ^~~
      |                          std::max
In file included from /usr/include/c++/10/algorithm:62,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from vision.cpp:1:
/usr/include/c++/10/bits/stl_algo.h:3486:5: note: 'std::max' declared here
 3486 |     max(initializer_list<_Tp> __l, _Compare __comp)
      |     ^~~
vision.cpp:6:4: error: 'add_and' was not declared in this scope
    6 |    add_and({i, i + K});
      |    ^~~~~~~
vision.cpp:9:2: error: 'vector' was not declared in this scope
    9 |  vector<int> v;
      |  ^~~~~~
vision.cpp:9:2: note: suggested alternatives:
In file included from /usr/include/c++/10/vector:67,
                 from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from vision.cpp:1:
/usr/include/c++/10/bits/stl_vector.h:389:11: note:   'std::vector'
  389 |     class vector : protected _Vector_base<_Tp, _Alloc>
      |           ^~~~~~
In file included from /usr/include/c++/10/functional:62,
                 from /usr/include/c++/10/pstl/glue_algorithm_defs.h:13,
                 from /usr/include/c++/10/algorithm:74,
                 from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:65,
                 from vision.cpp:1:
/usr/include/c++/10/vector:86:13: note:   'std::pmr::vector'
   86 |       using vector = std::vector<_Tp, polymorphic_allocator<_Tp>>;
      |             ^~~~~~
vision.cpp:9:9: error: expected primary-expression before 'int'
    9 |  vector<int> v;
      |         ^~~
vision.cpp:10:38: error: 'v' was not declared in this scope
   10 |  for(int i = H*W; i < H*W + ct; i++) v.push_back(i);
      |                                      ^
vision.cpp:11:9: error: 'v' was not declared in this scope
   11 |  add_or(v);
      |         ^
vision.cpp:11:2: error: 'add_or' was not declared in this scope
   11 |  add_or(v);
      |  ^~~~~~