# | 제출 시각 | 아이디 | 문제 | 언어 | 결과 | 실행 시간 | 메모리 |
---|---|---|---|---|---|---|---|
1141706 | otesunki | 시간이 돈 (balkan11_timeismoney) | C++17 | 컴파일 에러 | 0 ms | 0 KiB |
#include <iostream>
#include <vector>
int N, M;
std::vector<std::tuple<int, int>> chosen;
std::vector<std::tuple<int, int, int, int>> edges;
std::vector<int> reduction;
/*
template<class ForwardIt, class UnaryPred>
ForwardIt remove_if(ForwardIt first, ForwardIt last, UnaryPred p) {
for (ForwardIt i = first; ++i != last;)
if (!p(*i))
*first++ = std::move(*i);
return first;
}
*/
template<class InputIt, class UnaryPred>
constexpr InputIt find_if(InputIt first, InputIt last, UnaryPred p) {
for (; first != last; ++first)
if (p(*first))
return first;
return last;
}
template<class ForwardIt, class UnaryPred>
ForwardIt remove_if(ForwardIt first, ForwardIt last, UnaryPred p) {
first = find_if(first, last, p);
if (first != last)
for (ForwardIt i = first; ++i != last;)
if (!p(*i))
*first++ = std::move(*i);
return first;
}
int main(void) {
std::cin >> N >> M;
reduction.resize(N);
for (int i = 0; i < N; ++i) {
reduction[i] = i;
}
for (int i = 0; i < M; ++i) {
int a, b, t, c;
std::cin >> a >> b >> t >> c;
edges.push_back({a, b, t, c});
}
int time = 0, cost = 0;
for (;;) {
int mintime = -1, mincost = -1, mina = -1, minb = -1;
/*
std::cout << " time=" << time << "\n";
std::cout << " cost=" << cost << "\n";
for (int i = 0; i < edges.size(); ++i) {
std::cout << std::get<0>(edges[i]) << " [" << reduction[std::get<0>(edges[i])] << "] -> "
<< std::get<1>(edges[i]) << " [" << reduction[std::get<1>(edges[i])] << "] (t="
<< std::get<2>(edges[i]) << " | c=" << std::get<3>(edges[i]) << ")\n";
}
*/
for (int i = 0; i < edges.size(); ++i) {
int thistime = (std::get<2>(edges[i]) + time);
int thiscost = (std::get<3>(edges[i]) + cost);
/*
std::cout << "thistime=" << thistime << "\n";
std::cout << "thiscost=" << thiscost << "\n";
std::cout << "mintime=" << mintime << "\n";
std::cout << "mincost=" << mincost << "\n";
*/
if ((thistime * thiscost < mintime * mincost) || (mina == -1)) {
mintime = thistime;
mincost = thiscost;
mina = std::get<0>(edges[i]);
minb = std::get<1>(edges[i]);
}
}
time = mintime;
cost = mincost;
int minredi = 201, maxredi = 0;
chosen.push_back({mina, minb});
int reductionminb = reduction[minb];
int reductionmina = reduction[mina];
/*
std::cout << "merge " << reductionmina << " with " << reductionminb << "\n";
*/
for (int i = 0; i < N; ++i) {
if (reduction[i] == reductionminb) {
reduction[i] = reductionmina;
}
if (reduction[i] < minredi) {
minredi = reduction[i];
}
if (reduction[i] > maxredi) {
maxredi = reduction[i];
}
}
if (minredi == maxredi) {
break;
}
auto it = remove_if(std::begin(edges), std::end(edges), [](auto edge) {
/*
std::cout << " compare " << reduction[std::get<0>(edge)] << " & " << reduction[std::get<1>(edge)] << "\n";
*/
return reduction[std::get<0>(edge)] == reduction[std::get<1>(edge)];
});
edges.erase(it, std::end(edges));
}
std::cout << time << " " << cost << "\n";
for (auto edge : chosen) {
std::cout << std::get<0>(edge) << " " << std::get<1>(edge) << "\n";
}
return 0;
}
컴파일 시 표준 에러 (stderr) 메시지
timeismoney.cpp: In function 'int main()': timeismoney.cpp:48:20: error: no matching function for call to 'std::vector<std::tuple<int, int, int, int> >::push_back(<brace-enclosed initializer list>)' 48 | edges.push_back({a, b, t, c}); | ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/11/vector:67, from timeismoney.cpp:2: /usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<int, int, int, int>]' 1187 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/11/bits/stl_vector.h:1187:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::tuple<int, int, int, int>&'} 1187 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<int, int, int, int>]' 1203 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/11/bits/stl_vector.h:1203:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::tuple<int, int, int, int> >::value_type&&' {aka 'std::tuple<int, int, int, int>&&'} 1203 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ timeismoney.cpp:63:28: error: 'get' is not a member of 'std'; did you mean 'getc'? 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~ | getc timeismoney.cpp:63:45: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} and 'int') 63 | int thistime = (std::get<2>(edges[i]) + time); In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:585:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)' 585 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:585:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:1700:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)' 1700 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:1700:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6095:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 6095 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6095:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:56, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.tcc:1169:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 1169 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.tcc:1169:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: mismatched types 'const _CharT*' and 'std::tuple<int, int, int, int>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:56, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.tcc:1189:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 1189 | operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.tcc:1189:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 6132 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6132:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6148:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 6148 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6148:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6160:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 6160 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6160:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6166:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6166 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6166:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6172:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6172 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6172:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6194:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6194 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6194:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: mismatched types 'const _CharT*' and 'std::tuple<int, int, int, int>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6200:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6200 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6200:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6206:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 6206 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6206:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6212:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 6212 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6212:5: note: template argument deduction/substitution failed: timeismoney.cpp:63:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 63 | int thistime = (std::get<2>(edges[i]) + time); | ^~~~ timeismoney.cpp:64:28: error: 'get' is not a member of 'std'; did you mean 'getc'? 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~ | getc timeismoney.cpp:64:45: error: no match for 'operator+' (operand types are '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} and 'int') 64 | int thiscost = (std::get<3>(edges[i]) + cost); In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:585:5: note: candidate: 'template<class _Iterator> constexpr std::reverse_iterator<_Iterator> std::operator+(typename std::reverse_iterator<_Iterator>::difference_type, const std::reverse_iterator<_Iterator>&)' 585 | operator+(typename reverse_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:585:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: mismatched types 'const std::reverse_iterator<_Iterator>' and 'int' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/stl_iterator.h:1700:5: note: candidate: 'template<class _Iterator> constexpr std::move_iterator<_IteratorL> std::operator+(typename std::move_iterator<_IteratorL>::difference_type, const std::move_iterator<_IteratorL>&)' 1700 | operator+(typename move_iterator<_Iterator>::difference_type __n, | ^~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h:1700:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: mismatched types 'const std::move_iterator<_IteratorL>' and 'int' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6095:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 6095 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6095:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:56, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.tcc:1169:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 1169 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.tcc:1169:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: mismatched types 'const _CharT*' and 'std::tuple<int, int, int, int>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:56, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.tcc:1189:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 1189 | operator+(_CharT __lhs, const basic_string<_CharT, _Traits, _Alloc>& __rhs) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.tcc:1189:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: mismatched types 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6132:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, const _CharT*)' 6132 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6132:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6148:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, _CharT)' 6148 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, _CharT __rhs) | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6148:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6160:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&)' 6160 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6160:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6166:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6166 | operator+(const basic_string<_CharT, _Traits, _Alloc>& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6166:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'const std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6172:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6172 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6172:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6194:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(const _CharT*, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6194 | operator+(const _CharT* __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6194:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: mismatched types 'const _CharT*' and 'std::tuple<int, int, int, int>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6200:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(_CharT, std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&)' 6200 | operator+(_CharT __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6200:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: mismatched types 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' and 'int' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6206:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, const _CharT*)' 6206 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6206:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ In file included from /usr/include/c++/11/string:55, from /usr/include/c++/11/bits/locale_classes.h:40, from /usr/include/c++/11/bits/ios_base.h:41, from /usr/include/c++/11/ios:42, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/basic_string.h:6212:5: note: candidate: 'template<class _CharT, class _Traits, class _Alloc> std::__cxx11::basic_string<_CharT, _Traits, _Allocator> std::operator+(std::__cxx11::basic_string<_CharT, _Traits, _Allocator>&&, _CharT)' 6212 | operator+(basic_string<_CharT, _Traits, _Alloc>&& __lhs, | ^~~~~~~~ /usr/include/c++/11/bits/basic_string.h:6212:5: note: template argument deduction/substitution failed: timeismoney.cpp:64:47: note: '__gnu_cxx::__alloc_traits<std::allocator<std::tuple<int, int, int, int> >, std::tuple<int, int, int, int> >::value_type' {aka 'std::tuple<int, int, int, int>'} is not derived from 'std::__cxx11::basic_string<_CharT, _Traits, _Allocator>' 64 | int thiscost = (std::get<3>(edges[i]) + cost); | ^~~~ timeismoney.cpp:74:21: error: 'get' is not a member of 'std'; did you mean 'getc'? 74 | mina = std::get<0>(edges[i]); | ^~~ | getc timeismoney.cpp:75:21: error: 'get' is not a member of 'std'; did you mean 'getc'? 75 | minb = std::get<1>(edges[i]); | ^~~ | getc timeismoney.cpp:81:21: error: no matching function for call to 'std::vector<std::tuple<int, int> >::push_back(<brace-enclosed initializer list>)' 81 | chosen.push_back({mina, minb}); | ~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~ In file included from /usr/include/c++/11/vector:67, from timeismoney.cpp:2: /usr/include/c++/11/bits/stl_vector.h:1187:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(const value_type&) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<int, int>]' 1187 | push_back(const value_type& __x) | ^~~~~~~~~ /usr/include/c++/11/bits/stl_vector.h:1187:35: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'const value_type&' {aka 'const std::tuple<int, int>&'} 1187 | push_back(const value_type& __x) | ~~~~~~~~~~~~~~~~~~^~~ /usr/include/c++/11/bits/stl_vector.h:1203:7: note: candidate: 'void std::vector<_Tp, _Alloc>::push_back(std::vector<_Tp, _Alloc>::value_type&&) [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >; std::vector<_Tp, _Alloc>::value_type = std::tuple<int, int>]' 1203 | push_back(value_type&& __x) | ^~~~~~~~~ /usr/include/c++/11/bits/stl_vector.h:1203:30: note: no known conversion for argument 1 from '<brace-enclosed initializer list>' to 'std::vector<std::tuple<int, int> >::value_type&&' {aka 'std::tuple<int, int>&&'} 1203 | push_back(value_type&& __x) | ~~~~~~~~~~~~~^~~ timeismoney.cpp: In lambda function: timeismoney.cpp:105:29: error: 'get' is not a member of 'std'; did you mean 'getc'? 105 | return reduction[std::get<0>(edge)] == reduction[std::get<1>(edge)]; | ^~~ | getc timeismoney.cpp:105:61: error: 'get' is not a member of 'std'; did you mean 'getc'? 105 | return reduction[std::get<0>(edge)] == reduction[std::get<1>(edge)]; | ^~~ | getc timeismoney.cpp: In function 'int main()': timeismoney.cpp:111:13: error: 'std::tuple<int, int> edge' has incomplete type 111 | for (auto edge : chosen) { | ^~~~ timeismoney.cpp:112:23: error: 'get' is not a member of 'std'; did you mean 'getc'? 112 | std::cout << std::get<0>(edge) << " " << std::get<1>(edge) << "\n"; | ^~~ | getc timeismoney.cpp:112:51: error: 'get' is not a member of 'std'; did you mean 'getc'? 112 | std::cout << std::get<0>(edge) << " " << std::get<1>(edge) << "\n"; | ^~~ | getc In file included from /usr/include/c++/11/vector:67, from timeismoney.cpp:2: /usr/include/c++/11/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int>; _Alloc = std::allocator<std::tuple<int, int> >]': /usr/include/c++/11/bits/stl_vector.h:487:7: required from here /usr/include/c++/11/bits/stl_vector.h:336:49: error: invalid use of incomplete type 'class std::tuple<int, int>' 336 | _M_impl._M_end_of_storage - _M_impl._M_start); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.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/vector:67, from timeismoney.cpp:2: /usr/include/c++/11/bits/stl_vector.h: In instantiation of 'std::_Vector_base<_Tp, _Alloc>::~_Vector_base() [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >]': /usr/include/c++/11/bits/stl_vector.h:487:7: required from here /usr/include/c++/11/bits/stl_vector.h:336:49: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' 336 | _M_impl._M_end_of_storage - _M_impl._M_start); | ~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int, int, int>' 45 | class tuple; | ^~~~~ In file included from /usr/include/c++/11/vector:67, from timeismoney.cpp:2: /usr/include/c++/11/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::size_type std::vector<_Tp, _Alloc>::size() const [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::size_type = long unsigned int]': timeismoney.cpp:62:35: required from here /usr/include/c++/11/bits/stl_vector.h:919:50: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' 919 | { return size_type(this->_M_impl._M_finish - this->_M_impl._M_start); } | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int, int, int>' 45 | class tuple; | ^~~~~ In file included from /usr/include/c++/11/vector:67, from timeismoney.cpp:2: /usr/include/c++/11/bits/stl_vector.h: In instantiation of 'std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::reference = std::tuple<int, int, int, int>&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]': timeismoney.cpp:63:42: required from here /usr/include/c++/11/bits/stl_vector.h:1046:41: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' 1046 | return *(this->_M_impl._M_start + __n); | ~~~~~~~~~~~~~~~~~~~~~~~~^~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int, int, int>' 45 | class tuple; | ^~~~~ timeismoney.cpp: In instantiation of 'ForwardIt remove_if(ForwardIt, ForwardIt, UnaryPred) [with ForwardIt = __gnu_cxx::__normal_iterator<std::tuple<int, int, int, int>*, std::vector<std::tuple<int, int, int, int> > >; UnaryPred = main()::<lambda(auto:1)>]': timeismoney.cpp:101:24: required from here timeismoney.cpp:33:19: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' 33 | if (!p(*i)) | ~^~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int, int, int>' 45 | class tuple; | ^~~~~ timeismoney.cpp:101:61: note: initializing argument 1 of 'main()::<lambda(auto:1)> [with auto:1 = std::tuple<int, int, int, int>]' 101 | auto it = remove_if(std::begin(edges), std::end(edges), [](auto edge) { | ^ timeismoney.cpp:34:26: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' 34 | *first++ = std::move(*i); | ~~~~~~~~~^~~~~~~~~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int, int, int>' 45 | class tuple; | ^~~~~ timeismoney.cpp: In instantiation of 'constexpr InputIt find_if(InputIt, InputIt, UnaryPred) [with InputIt = __gnu_cxx::__normal_iterator<std::tuple<int, int, int, int>*, std::vector<std::tuple<int, int, int, int> > >; UnaryPred = main()::<lambda(auto:1)>]': timeismoney.cpp:30:20: required from 'ForwardIt remove_if(ForwardIt, ForwardIt, UnaryPred) [with ForwardIt = __gnu_cxx::__normal_iterator<std::tuple<int, int, int, int>*, std::vector<std::tuple<int, int, int, int> > >; UnaryPred = main()::<lambda(auto:1)>]' timeismoney.cpp:101:24: required from here timeismoney.cpp:22:14: error: invalid use of incomplete type 'class std::tuple<int, int, int, int>' 22 | if (p(*first)) | ~^~~~~~~~ In file included from /usr/include/c++/11/bits/move.h:57, from /usr/include/c++/11/bits/exception_ptr.h:43, from /usr/include/c++/11/exception:153, from /usr/include/c++/11/ios:39, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/type_traits:45:11: note: declaration of 'class std::tuple<int, int, int, int>' 45 | class tuple; | ^~~~~ timeismoney.cpp:101:61: note: initializing argument 1 of 'main()::<lambda(auto:1)> [with auto:1 = std::tuple<int, int, int, int>]' 101 | auto it = remove_if(std::begin(edges), std::end(edges), [](auto edge) { | ^ In file included from /usr/include/c++/11/bits/stl_algobase.h:67, from /usr/include/c++/11/bits/char_traits.h:39, from /usr/include/c++/11/ios:40, from /usr/include/c++/11/ostream:38, from /usr/include/c++/11/iostream:39, from timeismoney.cpp:1: /usr/include/c++/11/bits/stl_iterator.h: In instantiation of '__gnu_cxx::__normal_iterator<_Iterator, _Container>& __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator++() [with _Iterator = std::tuple<int, int>*; _Container = std::vector<std::tuple<int, int> >]': timeismoney.cpp:111:20: required from here /usr/include/c++/11/bits/stl_iterator.h:1054:11: error: cannot increment a pointer to incomplete type 'std::tuple<int, int>' 1054 | ++_M_current; | ^~~~~~~~~~ /usr/include/c++/11/bits/stl_iterator.h: In instantiation of '__gnu_cxx::__normal_iterator<_Iterator, _Container>& __gnu_cxx::__normal_iterator<_Iterator, _Container>::operator++() [with _Iterator = std::tuple<int, int, int, int>*; _Container = std::vector<std::tuple<int, int, int, int> >]': timeismoney.cpp:32:35: required from 'ForwardIt remove_if(ForwardIt, ForwardIt, UnaryPred) [with ForwardIt = __gnu_cxx::__normal_iterator<std::tuple<int, int, int, int>*, std::vector<std::tuple<int, int, int, int> > >; UnaryPred = main()::<lambda(auto:1)>]' timeismoney.cpp:101:24: required from here /usr/include/c++/11/bits/stl_iterator.h:1054:11: error: cannot increment a pointer to incomplete type 'std::tuple<int, int, int, int>' /usr/include/c++/11/bits/stl_iterator.h: In instantiation of 'typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type __gnu_cxx::operator-(const __gnu_cxx::__normal_iterator<_Iterator, _Container>&, const __gnu_cxx::__normal_iterator<_Iterator, _Container>&) [with _Iterator = const std::tuple<int, int, int, int>*; _Container = std::vector<std::tuple<int, int, int, int> >; typename __gnu_cxx::__normal_iterator<_Iterator, _Container>::difference_type = long int]': /usr/include/c++/11/bits/stl_vector.h:1461:35: required from 'std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::erase(std::vector<_Tp, _Alloc>::const_iterator, std::vector<_Tp, _Alloc>::const_iterator) [with _Tp = std::tuple<int, int, int, int>; _Alloc = std::allocator<std::tuple<int, int, int, int> >; std::vector<_Tp, _Alloc>::iterator = std::vector<std::tuple<int, int, int, int> >::iterator; std::vector<_Tp, _Alloc>::const_iterator = std::vector<std::tuple<int, int, int, int> >::const_iterator]' timeismoney.cpp:107:16: required from here /usr/include/c++/11/bits/stl_iterator.h:1271:27: error: invalid use of incomplete type 'const class std::tuple<int, int, int, int>' 1271 | { return __lhs.base() - __rhs.base(); }