# | TimeUTC-0 | Username | Problem | Language | Result | Execution time | Memory |
---|---|---|---|---|---|---|---|
1159261 | 2025-02-28 09:55:09 | Gr1sen | Werewolf (IOI18_werewolf) | C++17 | Compilation error | 0 ms | 0 KiB |
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
#include "werewolf.h"
#include<iostream>
#include<queue>
using namespace std;
#define vi vector<int>
#define vvi vector<vi>
#define qq queue<tuple<int, int>>
#define G(a, b) get<a>(b)
vvi Adj;
bool oink(int a, int b, int l, int r) {
vi M(Adj.size(), 0);
if (a == b) return 1;
qq Q;
Q.push({a, 1});
Q.push({b, 2});
while (!Q.empty()) {
int c = G(0, Q.front()), d = G(1, Q.front());
Q.pop();
if (d == 1 && c < l) continue;
if (d == 2 && c > r) continue;
if (M[c] != 0) {
if (M[c] == d) continue;
return 1;
}
M[c] = d;
for (auto i : Adj[c]) {
הההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההההה
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
Compilation message (stderr)
werewolf.cpp: In function 'bool oink(int, int, int, int)': werewolf.cpp:18:15: error: no matching function for call to 'std::queue<std::tuple<int, int> >::push(<brace-enclosed initializer list>)' 18 | Q.push({a, 1}); | ~~~~~~^~~~~~~~ In file included from /usr/include/c++/11/queue:64, from werewolf.cpp:3: /usr/include/c++/11/bits/stl_queue.h:265:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::tuple<int, int>]' 265 | push(const value_type& __x) | ^~~~ /usr/include/c++/11/bits/stl_queue.h:265:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::tuple<int, int>&'} 265 | push(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_queue.h:270:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::tuple<int, int>]' 270 | push(value_type&& __x) | ^~~~ /usr/include/c++/11/bits/stl_queue.h:270:25: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::tuple<int, int> >::value_type&&' {aka 'std::tuple<int, int>&&'} 270 | push(value_type&& __x) | ~~~~~~~~~~~~~^~~ werewolf.cpp:19:15: error: no matching function for call to 'std::queue<std::tuple<int, int> >::push(<brace-enclosed initializer list>)' 19 | Q.push({b, 2}); | ~~~~~~^~~~~~~~ In file included from /usr/include/c++/11/queue:64, from werewolf.cpp:3: /usr/include/c++/11/bits/stl_queue.h:265:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::tuple<int, int>]' 265 | push(const value_type& __x) | ^~~~ /usr/include/c++/11/bits/stl_queue.h:265:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::tuple<int, int>&'} 265 | push(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_queue.h:270:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::tuple<int, int>]' 270 | push(value_type&& __x) | ^~~~ /usr/include/c++/11/bits/stl_queue.h:270:25: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::tuple<int, int> >::value_type&&' {aka 'std::tuple<int, int>&&'} 270 | push(value_type&& __x) | ~~~~~~~~~~~~~^~~ werewolf.cpp:10:17: error: 'get' was not declared in this scope; did you mean 'getw'? 10 | #define G(a, b) get<a>(b) | ^~~ werewolf.cpp:21:25: note: in expansion of macro 'G' 21 | int c = G(0, Q.front()), d = G(1, Q.front()); | ^ werewolf.cpp:23:21: error: 'd' was not declared in this scope 23 | if (d == 1 && c < l) continue; | ^ werewolf.cpp:24:21: error: 'd' was not declared in this scope 24 | if (d == 2 && c > r) continue; | ^ werewolf.cpp:26:37: error: 'd' was not declared in this scope 26 | if (M[c] == d) continue; | ^ werewolf.cpp:29:24: error: 'd' was not declared in this scope 29 | M[c] = d; | ^ werewolf.cpp:31:31: error: no matching function for call to 'std::queue<std::tuple<int, int> >::push(<brace-enclosed initializer list>)' 31 | Q.push({i, d}); | ~~~~~~^~~~~~~~ In file included from /usr/include/c++/11/queue:64, from werewolf.cpp:3: /usr/include/c++/11/bits/stl_queue.h:265:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(const value_type&) [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::tuple<int, int>]' 265 | push(const value_type& __x) | ^~~~ /usr/include/c++/11/bits/stl_queue.h:265:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::tuple<int, int>&'} 265 | push(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_queue.h:270:7: note: candidate: 'void std::queue<_Tp, _Sequence>::push(std::queue<_Tp, _Sequence>::value_type&&) [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; std::queue<_Tp, _Sequence>::value_type = std::tuple<int, int>]' 270 | push(value_type&& __x) | ^~~~ /usr/include/c++/11/bits/stl_queue.h:270:25: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::queue<std::tuple<int, int> >::value_type&&' {aka 'std::tuple<int, int>&&'} 270 | push(value_type&& __x) | ~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/11/deque:67, from /usr/include/c++/11/queue:60, from werewolf.cpp:3: /usr/include/c++/11/bits/stl_deque.h: In instantiation of 'void std::deque<_Tp, _Alloc>::_M_destroy_data(std::deque<_Tp, _Alloc>::iterator, std::deque<_Tp, _Alloc>::iterator, const std::allocator<_Tp1>&) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::deque<_Tp, _Alloc>::iterator = std::_Deque_base<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >::iterator]': /usr/include/c++/11/bits/stl_deque.h:1007:24: required from 'std::deque<_Tp, _Alloc>::~deque() [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >]' /usr/include/c++/11/bits/stl_queue.h:96:11: required from here /usr/include/c++/11/bits/stl_deque.h:2048:14: error: invalid use of incomplete type 'std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >::value_type' {aka 'class std::tuple<int, int>'} 2048 | if (!__has_trivial_destructor(value_type)) | ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/vector:60, from werewolf.h:3, from werewolf.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >::value_type' {aka 'class std::tuple<int, int>'} 45 | class tuple; | ^~~~~ In file included from /usr/include/c++/11/deque:67, from /usr/include/c++/11/queue:60, from werewolf.cpp:3: /usr/include/c++/11/bits/stl_deque.h: In instantiation of 'void std::deque<_Tp, _Alloc>::pop_front() [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >]': /usr/include/c++/11/bits/stl_queue.h:301:13: required from 'void std::queue<_Tp, _Sequence>::pop() [with _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >]' werewolf.cpp:22:8: required from here /usr/include/c++/11/bits/stl_deque.h:1536:47: error: invalid use of incomplete type 'class std::tuple<int, int>' 1536 | != this->_M_impl._M_start._M_last - 1) | ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/stl_pair.h:59, from /usr/include/c++/11/bits/stl_algobase.h:64, from /usr/include/c++/11/vector:60, from werewolf.h:3, from werewolf.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int>' 45 | class tuple; | ^~~~~ In file included from /usr/include/c++/11/deque:67, from /usr/include/c++/11/queue:60, from werewolf.cpp:3: /usr/include/c++/11/bits/stl_deque.h:1540:38: error: cannot increment a pointer to incomplete type 'std::tuple<int, int>' 1540 | ++this->_M_impl._M_start._M_cur; | ~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ /usr/include/c++/11/bits/stl_deque.h: In instantiation of 'void std::_Deque_base<_Tp, _Alloc>::_M_initialize_map(std::size_t) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::size_t = long unsigned int]': /usr/include/c++/11/bits/stl_deque.h:439:9: required from 'std::_Deque_base<_Tp, _Alloc>::_Deque_base() [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >]' /usr/include/c++/11/bits/stl_deque.h:834:7: required from 'std::queue<_Tp, _Sequence>::queue() [with _Seq = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; _Requires = void; _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >]' werewolf.cpp:17:5: required from here /usr/include/c++/11/bits/stl_deque.h:620:69: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int>' 620 | const size_t __num_nodes = (__num_elements / __deque_buf_size(sizeof(_Tp)) | ^~~~~~~~~~~ /usr/include/c++/11/bits/stl_deque.h:651:60: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int>' 651 | % __deque_buf_size(sizeof(_Tp))); | ^~~~~~~~~~~ /usr/include/c++/11/bits/stl_deque.h: In instantiation of 'void std::_Deque_base<_Tp, _Alloc>::_M_deallocate_node(std::_Deque_base<_Tp, _Alloc>::_Ptr) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::_Deque_base<_Tp, _Alloc>::_Ptr = std::tuple<int, int>*]': /usr/include/c++/11/bits/stl_deque.h:679:2: required from 'void std::_Deque_base<_Tp, _Alloc>::_M_destroy_nodes(std::_Deque_base<_Tp, _Alloc>::_Map_pointer, std::_Deque_base<_Tp, _Alloc>::_Map_pointer) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::_Deque_base<_Tp, _Alloc>::_Map_pointer = std::tuple<int, int>**]' /usr/include/c++/11/bits/stl_deque.h:601:4: required from 'std::_Deque_base<_Tp, _Alloc>::~_Deque_base() [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >]' /usr/include/c++/11/bits/stl_deque.h:834:7: required from 'std::queue<_Tp, _Sequence>::queue() [with _Seq = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; _Requires = void; _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >]' werewolf.cpp:17:5: required from here /usr/include/c++/11/bits/stl_deque.h:569:60: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int>' 569 | _Traits::deallocate(_M_impl, __p, __deque_buf_size(sizeof(_Tp))); | ^~~~~~~~~~~ In file included from /usr/include/x86_64-linux-gnu/c++/11/bits/c++allocator.h:33, from /usr/include/c++/11/bits/allocator.h:46, from /usr/include/c++/11/vector:64, from werewolf.h:3, from werewolf.cpp:1: /usr/include/c++/11/ext/new_allocator.h: In instantiation of 'void __gnu_cxx::new_allocator<_Tp>::deallocate(_Tp*, __gnu_cxx::new_allocator<_Tp>::size_type) [with _Tp = std::tuple<int, int>; __gnu_cxx::new_allocator<_Tp>::size_type = long unsigned int]': /usr/include/c++/11/bits/alloc_traits.h:496:23: required from 'static void std::allocator_traits<std::allocator<_Tp1> >::deallocate(std::allocator_traits<std::allocator<_Tp1> >::allocator_type&, std::allocator_traits<std::allocator<_Tp1> >::pointer, std::allocator_traits<std::allocator<_Tp1> >::size_type) [with _Tp = std::tuple<int, int>; std::allocator_traits<std::allocator<_Tp1> >::allocator_type = std::allocator<std::tuple<int, int> >; std::allocator_traits<std::allocator<_Tp1> >::pointer = std::tuple<int, int>*; std::allocator_traits<std::allocator<_Tp1> >::size_type = long unsigned int]' /usr/include/c++/11/bits/stl_deque.h:569:21: required from 'void std::_Deque_base<_Tp, _Alloc>::_M_deallocate_node(std::_Deque_base<_Tp, _Alloc>::_Ptr) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::_Deque_base<_Tp, _Alloc>::_Ptr = std::tuple<int, int>*]' /usr/include/c++/11/bits/stl_deque.h:679:2: required from 'void std::_Deque_base<_Tp, _Alloc>::_M_destroy_nodes(std::_Deque_base<_Tp, _Alloc>::_Map_pointer, std::_Deque_base<_Tp, _Alloc>::_Map_pointer) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::_Deque_base<_Tp, _Alloc>::_Map_pointer = std::tuple<int, int>**]' /usr/include/c++/11/bits/stl_deque.h:601:4: required from 'std::_Deque_base<_Tp, _Alloc>::~_Deque_base() [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >]' /usr/include/c++/11/bits/stl_deque.h:834:7: required from 'std::queue<_Tp, _Sequence>::queue() [with _Seq = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >; _Requires = void; _Tp = std::tuple<int, int>; _Sequence = std::deque<std::tuple<int, int>, std::allocator<std::tuple<int, int> > >]' werewolf.cpp:17:5: required from here /usr/include/c++/11/ext/new_allocator.h:135:13: error: invalid application of '__alignof__' to incomplete type 'std::tuple<int, int>' 135 | if (alignof(_Tp) > __STDCPP_DEFAULT_NEW_ALIGNMENT__) | ^~~~~~~~~~~~ /usr/include/c++/11/ext/new_allocator.h:139:37: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int>' 139 | __t * sizeof(_Tp), | ^~~~~~~~~~~ /usr/include/c++/11/ext/new_allocator.h:141:48: error: invalid application of '__alignof__' to incomplete type 'std::tuple<int, int>' 141 | std::align_val_t(alignof(_Tp))); | ^~~~~~~~~~~~ /usr/include/c++/11/ext/new_allocator.h:147:35: error: invalid application of 'sizeof' to incomplete type 'std::tuple<int, int>' 147 | , __t * sizeof(_Tp) | ^~~~~~~~~~~