Joker.cpp: In function 'bool sub34::unite(int, int)':
Joker.cpp:115:40: error: cannot convert 'std::pair<const int, bool>' to 'int'
115 | if (st[u][flip(x)] == 1) return 1;
| ^
| |
| std::pair<const int, bool>
Joker.cpp:93:22: note: initializing argument 1 of 'int sub34::flip(int)'
93 | int flip(int v) {
| ~~~~^
Joker.cpp:117:30: error: no match for 'operator[]' (operand types are 'std::unordered_map<int, bool>' and 'std::pair<const int, bool>')
117 | st[u][x] = 1;
| ^
In file included from /usr/include/c++/13/unordered_map:41,
from /usr/include/c++/13/functional:63,
from /usr/include/x86_64-linux-gnu/c++/13/bits/stdc++.h:53,
from Joker.cpp:1:
/usr/include/c++/13/bits/unordered_map.h:986:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](const key_type&) [with _Key = int; _Tp = bool; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, bool> >; mapped_type = bool; key_type = int]'
986 | operator[](const key_type& __k)
| ^~~~~~~~
/usr/include/c++/13/bits/unordered_map.h:986:34: note: no known conversion for argument 1 from 'std::pair<const int, bool>' to 'const std::unordered_map<int, bool>::key_type&' {aka 'const int&'}
986 | operator[](const key_type& __k)
| ~~~~~~~~~~~~~~~~^~~
/usr/include/c++/13/bits/unordered_map.h:990:7: note: candidate: 'std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::mapped_type& std::unordered_map<_Key, _Tp, _Hash, _Pred, _Alloc>::operator[](key_type&&) [with _Key = int; _Tp = bool; _Hash = std::hash<int>; _Pred = std::equal_to<int>; _Alloc = std::allocator<std::pair<const int, bool> >; mapped_type = bool; key_type = int]'
990 | operator[](key_type&& __k)
| ^~~~~~~~
/usr/include/c++/13/bits/unordered_map.h:990:29: note: no known conversion for argument 1 from 'std::pair<const int, bool>' to 'std::unordered_map<int, bool>::key_type&&' {aka 'int&&'}
990 | operator[](key_type&& __k)
| ~~~~~~~~~~~^~~
Joker.cpp: In function 'int main()':
Joker.cpp:180:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
180 | freopen(task".inp", "r", stdin);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
Joker.cpp:181:24: warning: ignoring return value of 'FILE* freopen(const char*, const char*, FILE*)' declared with attribute 'warn_unused_result' [-Wunused-result]
181 | freopen(task".out", "w", stdout);
| ~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~~