#include <iostream>
#include <vector>
#include <cstdint>
#include <tuple>
#include <algorithm>
#include <array>
//not debug some function.
typedef std::vector<std::vector<std::uint64_t>> MapType;
typedef std::tuple<std::int64_t, std::int64_t> Point;
typedef std::vector<Point> FootPrint;
int Pa = 2;
std::uintmax_t PoorSearch(const MapType& M, const Point& Fst, const Point& Last) {
std::uintmax_t W = 0;
std::int64_t i = 0;
std::size_t j = 0;
for (j= std::get<1>(Fst);j != std::get<1>(Last); j += (std::get<1>(Fst) - std::get<1>(Last)) ? 1 : -1) {
W += M[j][std::get<0>(Fst)];
}
for (i = std::get<0>(Fst); i != std::get<0>(Last); i += (std::get<0>(Fst) - std::get<0>(Last)) ? 1 : -1) {
W += M[j-1][i];
}
return W;
}
/**/
bool SearchPath_r(const MapType& M, FootPrint FP, const Point& Now, const Point& Last, const std::uintmax_t& Wait, std::intmax_t& Min,FootPrint& FPR) {
static std::array<int, 4> XP = { 0,1,0,-1 };
static std::array<int, 4> YP = { 1,0,-1,0 };
static std::uintmax_t C = 0;
auto X1 = std::get<0>(Now);
auto Y1 = std::get<1>(Now);
auto X2 = std::max<int>(std::get<0>(Last)-1, 0);
auto Y2 = std::max<int>(std::get<1>(Last)-1, 0);
if ((X1 == X2) && (Y1 == Y2)) {
if (Min >= Wait) {
FP.push_back({ X1,Y1 });
Min = Wait;
C++;
FPR = FP;
//ESS::Locate(15, 0);
//std::cout << C;
}
//ESS::Locate(std::get<0>(Now)+Pa, std::get<1>(Now)+Pa);
//std::cout << ' ';
return true;
}
if (Min <= Wait) {
//ESS::Locate(std::get<0>(Now)+Pa, std::get<1>(Now)+Pa);
//std::cout << ' ';
return false;
}
//ESS::Locate(std::get<0>(Now)+Pa, std::get<1>(Now)+Pa);
//std::cout << '*' ;
FP.push_back({ std::get<0>(Now),std::get<1>(Now) });
for (std::size_t i = 0; i < 4; i++) {
if (std::get<0>(Now) + XP[i] < 0) { continue; };
if (std::get<1>(Now) + YP[i] < 0) { continue; };
if (std::get<0>(Now) + XP[i] >= M.front().size() ) { continue; }
if (std::get<1>(Now) + YP[i] >= M.size()) { continue; }
auto it = std::find_if(FP.begin(), FP.end(), [&](auto& o) {return (std::get<0>(o) == std::get<0>(Now) + XP[i]) && (std::get<1>(o) == std::get<1>(Now) + YP[i]); });
if (it != FP.end()) { continue; }
SearchPath_r(M, FP,{ std::get<0>(Now) + XP[i],std::get<1>(Now) + YP[i] }, Last, Wait + M[std::get<1>(Now) + YP[i]][std::get<0>(Now) + XP[i]], Min,FPR);
}
FP.pop_back();
//ESS::Locate(std::get<0>(Now)+Pa, std::get<1>(Now)+Pa);
//std::cout << ' ';
return true;
}
std::tuple<std::uintmax_t,FootPrint> SearchPath(const MapType& M, const Point& Fst, const Point& Last) {
std::intmax_t Min = PoorSearch(M, Fst, Last);
FootPrint fp;
FootPrint FPR;
//fp.push_back({ 0,0 });
//ESS::Locate(std::get<0>(Fst)+Pa, std::get<1>(Fst)+Pa);
//std::cout << '*';
SearchPath_r(M, fp, Fst, Last, 0, Min,FPR);
return { Min,FPR };
}
typedef std::tuple<Point, std::uint64_t,std::uintmax_t,std::uintmax_t> FootData;//pos,dir,weight,now_weight
typedef std::vector<FootData> FootPrint2;
std::tuple<std::uintmax_t,FootPrint2> SearchPathL(const MapType& M, const Point& Fst, const Point& Last){
static std::array<int, 4> XP = { 0,1,0,-1 };
static std::array<int, 4> YP = { 1,0,-1,0 };
std::uintmax_t MinWeight = PoorSearch(M, Fst, Last);
std::uintmax_t Weight = 0;
FootPrint2 FP;
FootPrint2 R;
FP.push_back({ Fst,0,0,0 });
while (FP.size()) {
for (std::get<1>(FP.back()); std::get<1>(FP.back()) < 4; std::get<1>(FP.back())++) {
auto i = std::get<1>(FP.back());
auto& o = FP.back();
auto& P = std::get<0>(o);
if (std::get<0>(P) + XP[i] < 0) { continue; }
if (std::get<1>(P) + YP[i] < 0) { continue; }
if (std::get<0>(P) + XP[i] >= M.front().size()) { continue; }
if (std::get<1>(P) + YP[i] >= M.size()) { continue; }
auto X = std::get<0>(P) + XP[i];
auto Y = std::get<1>(P) + YP[i];
auto it = std::find_if(FP.begin(), FP.end(), [&](auto& o) {return (std::get<0>(std::get<0>(o)) == X) && (std::get<1>(std::get<0>(o)) == Y); });
if (it != FP.end()) { continue; }
if (Weight + M[Y][X] >= MinWeight) {
//FP.pop_back();
continue;
}
Weight += M[Y][X];
if (X == std::get<0>(Last) && Y == std::get<1>(Last)) {
if (Weight < MinWeight) {
R = FP;
MinWeight = Weight;
}
FP.pop_back();
continue;
}
FP.push_back({ { X,Y },0, M[Y][X], Weight });
}
} return { MinWeight,R };
}
MapType MakeVector() {
MapType M{
{0,2,9,5,3,9,4,1,3 },
{7,1,5,4,6,7,9,8,8 },
{8,3,4,1,1,2,9,4,6 },
{2,3,7,1,6,5,4,2,6 },
{4,7,3,8,5,7,3,6,0 },
};
return M;
}
int main() {
MapType M = MakeVector();
FootPrint FP;
FootPrint2 FP2;
std::uintmax_t R;
//std::tie(R,FP) = SearchPath(M, { 0,0 }, { 9,5 });
std::tie(R,FP2) = SearchPathL(M, { 0,0 }, { 9,5 });
//ESS::Locate(0, 10);
std::cout << R << std::endl;
for (auto& o : FP2) {
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
//std::cout << std::get<0>(std::get<0>(o)) << ',' << std::get<1>(std::get<0>(o)) << ',' << M[std::get<1>(std::get<0>(o))][std::get<0>(std::get<0>(o))] << std::endl;
}
return 0;
}
I2luY2x1ZGUgPGlvc3RyZWFtPgojaW5jbHVkZSA8dmVjdG9yPgojaW5jbHVkZSA8Y3N0ZGludD4KI2luY2x1ZGUgPHR1cGxlPiAKI2luY2x1ZGUgPGFsZ29yaXRobT4KI2luY2x1ZGUgPGFycmF5PgoKLy9ub3QgZGVidWcgc29tZSBmdW5jdGlvbi4KCnR5cGVkZWYgc3RkOjp2ZWN0b3I8c3RkOjp2ZWN0b3I8c3RkOjp1aW50NjRfdD4+IE1hcFR5cGU7CnR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kOjpnZXQ8MT4oc3RkOjpnZXQ8MD4obykpIDw8ICcsJyA8PCBNW3N0ZDo6Z2V0PDE+KHN0ZDo6Z2V0PDA+KG8pKV1bc3RkOjpnZXQ8MD4oc3RkOjpnZXQ8MD4obykpXSA8PCBzdGQ6OmVuZGw7Cgl9CgoJcmV0dXJuIDA7Cn0=
prog.cpp: In function ‘int main()’:
prog.cpp:172:13: error: no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’)
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~^~~~~~~~~~~~~~~~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:628:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&&, const _Tp&) [with _CharT = char; _Traits = std::char_traits<char>; _Tp = std::tuple<long int, long int>] <near match>
operator<<(basic_ostream<_CharT, _Traits>&& __os, const _Tp& __x)
^~~~~~~~
/usr/include/c++/6/ostream:628:5: note: conversion of argument 1 would be ill-formed:
prog.cpp:172:29: error: cannot bind ‘std::ostream {aka std::basic_ostream<char>}’ lvalue to ‘std::basic_ostream<char>&&’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
^
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:108:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ostream_type& (*)(std::basic_ostream<_CharT, _Traits>::__ostream_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(__ostream_type& (*__pf)(__ostream_type&))
^~~~~~~~
/usr/include/c++/6/ostream:108:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘std::basic_ostream<char>::__ostream_type& (*)(std::basic_ostream<char>::__ostream_type&) {aka std::basic_ostream<char>& (*)(std::basic_ostream<char>&)}’
/usr/include/c++/6/ostream:117:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__ios_type& (*)(std::basic_ostream<_CharT, _Traits>::__ios_type&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>; std::basic_ostream<_CharT, _Traits>::__ios_type = std::basic_ios<char>]
operator<<(__ios_type& (*__pf)(__ios_type&))
^~~~~~~~
/usr/include/c++/6/ostream:117:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘std::basic_ostream<char>::__ios_type& (*)(std::basic_ostream<char>::__ios_type&) {aka std::basic_ios<char>& (*)(std::basic_ios<char>&)}’
/usr/include/c++/6/ostream:127:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(std::ios_base& (*)(std::ios_base&)) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(ios_base& (*__pf) (ios_base&))
^~~~~~~~
/usr/include/c++/6/ostream:127:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘std::ios_base& (*)(std::ios_base&)’
/usr/include/c++/6/ostream:166:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(long __n)
^~~~~~~~
/usr/include/c++/6/ostream:166:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘long int’
/usr/include/c++/6/ostream:170:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(unsigned long __n)
^~~~~~~~
/usr/include/c++/6/ostream:170:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘long unsigned int’
/usr/include/c++/6/ostream:174:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(bool) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(bool __n)
^~~~~~~~
/usr/include/c++/6/ostream:174:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘bool’
In file included from /usr/include/c++/6/ostream:638:0,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/ostream.tcc:91:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(short int) [with _CharT = char; _Traits = std::char_traits<char>]
basic_ostream<_CharT, _Traits>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/6/bits/ostream.tcc:91:5: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘short int’
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:181:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(short unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(unsigned short __n)
^~~~~~~~
/usr/include/c++/6/ostream:181:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘short unsigned int’
In file included from /usr/include/c++/6/ostream:638:0,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/ostream.tcc:105:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(int) [with _CharT = char; _Traits = std::char_traits<char>]
basic_ostream<_CharT, _Traits>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/6/bits/ostream.tcc:105:5: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘int’
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:192:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(unsigned int __n)
^~~~~~~~
/usr/include/c++/6/ostream:192:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘unsigned int’
/usr/include/c++/6/ostream:201:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(long long __n)
^~~~~~~~
/usr/include/c++/6/ostream:201:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘long long int’
/usr/include/c++/6/ostream:205:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long long unsigned int) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(unsigned long long __n)
^~~~~~~~
/usr/include/c++/6/ostream:205:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘long long unsigned int’
/usr/include/c++/6/ostream:220:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(double __f)
^~~~~~~~
/usr/include/c++/6/ostream:220:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘double’
/usr/include/c++/6/ostream:224:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(float) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(float __f)
^~~~~~~~
/usr/include/c++/6/ostream:224:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘float’
/usr/include/c++/6/ostream:232:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(long double) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(long double __f)
^~~~~~~~
/usr/include/c++/6/ostream:232:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘long double’
/usr/include/c++/6/ostream:245:7: note: candidate: std::basic_ostream<_CharT, _Traits>::__ostream_type& std::basic_ostream<_CharT, _Traits>::operator<<(const void*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__ostream_type = std::basic_ostream<char>]
operator<<(const void* __p)
^~~~~~~~
/usr/include/c++/6/ostream:245:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘const void*’
In file included from /usr/include/c++/6/ostream:638:0,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/ostream.tcc:119:5: note: candidate: std::basic_ostream<_CharT, _Traits>& std::basic_ostream<_CharT, _Traits>::operator<<(std::basic_ostream<_CharT, _Traits>::__streambuf_type*) [with _CharT = char; _Traits = std::char_traits<char>; std::basic_ostream<_CharT, _Traits>::__streambuf_type = std::basic_streambuf<char>]
basic_ostream<_CharT, _Traits>::
^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/usr/include/c++/6/bits/ostream.tcc:119:5: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘std::basic_ostream<char>::__streambuf_type* {aka std::basic_streambuf<char>*}’
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:574:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const unsigned char*)
operator<<(basic_ostream<char, _Traits>& __out, const unsigned char* __s)
^~~~~~~~
/usr/include/c++/6/ostream:574:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘const unsigned char*’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:569:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const signed char*)
operator<<(basic_ostream<char, _Traits>& __out, const signed char* __s)
^~~~~~~~
/usr/include/c++/6/ostream:569:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘const signed char*’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:556:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, const char*)
operator<<(basic_ostream<char, _Traits>& __out, const char* __s)
^~~~~~~~
/usr/include/c++/6/ostream:556:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘const char*’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/ostream:638:0,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/ostream.tcc:321:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const char*)
operator<<(basic_ostream<_CharT, _Traits>& __out, const char* __s)
^~~~~~~~
/usr/include/c++/6/bits/ostream.tcc:321:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘const char*’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:539:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const _CharT*)
operator<<(basic_ostream<_CharT, _Traits>& __out, const _CharT* __s)
^~~~~~~~
/usr/include/c++/6/ostream:539:5: note: template argument deduction/substitution failed:
prog.cpp:172:29: note: mismatched types ‘const _CharT*’ and ‘std::tuple<long int, long int>’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
^
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:519:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, unsigned char)
operator<<(basic_ostream<char, _Traits>& __out, unsigned char __c)
^~~~~~~~
/usr/include/c++/6/ostream:519:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘unsigned char’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:514:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, signed char)
operator<<(basic_ostream<char, _Traits>& __out, signed char __c)
^~~~~~~~
/usr/include/c++/6/ostream:514:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘signed char’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:508:5: note: candidate: template<class _Traits> std::basic_ostream<char, _Traits>& std::operator<<(std::basic_ostream<char, _Traits>&, char)
operator<<(basic_ostream<char, _Traits>& __out, char __c)
^~~~~~~~
/usr/include/c++/6/ostream:508:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘char’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:502:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, char)
operator<<(basic_ostream<_CharT, _Traits>& __out, char __c)
^~~~~~~~
/usr/include/c++/6/ostream:502:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘char’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/iostream:39:0,
from prog.cpp:1:
/usr/include/c++/6/ostream:497:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, _CharT)
operator<<(basic_ostream<_CharT, _Traits>& __out, _CharT __c)
^~~~~~~~
/usr/include/c++/6/ostream:497:5: note: template argument deduction/substitution failed:
prog.cpp:172:29: note: deduced conflicting types for parameter ‘_CharT’ (‘char’ and ‘std::tuple<long int, long int>’)
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
^
In file included from /usr/include/c++/6/bits/ios_base.h:46:0,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/system_error:209:5: note: candidate: template<class _CharT, class _Traits> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::error_code&)
operator<<(basic_ostream<_CharT, _Traits>& __os, const error_code& __e)
^~~~~~~~
/usr/include/c++/6/system_error:209:5: note: template argument deduction/substitution failed:
prog.cpp:172:27: note: cannot convert ‘std::get<0ul, {std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int}>((* & o))’ (type ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’) to type ‘const std::error_code&’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
~~~~~~~~~~~^~~
In file included from /usr/include/c++/6/string:52:0,
from /usr/include/c++/6/bits/locale_classes.h:40,
from /usr/include/c++/6/bits/ios_base.h:41,
from /usr/include/c++/6/ios:42,
from /usr/include/c++/6/ostream:38,
from /usr/include/c++/6/iostream:39,
from prog.cpp:1:
/usr/include/c++/6/bits/basic_string.h:5340:5: note: candidate: template<class _CharT, class _Traits, class _Alloc> std::basic_ostream<_CharT, _Traits>& std::operator<<(std::basic_ostream<_CharT, _Traits>&, const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&)
operator<<(basic_ostream<_CharT, _Traits>& __os,
^~~~~~~~
/usr/include/c++/6/bits/basic_string.h:5340:5: note: template argument deduction/substitution failed:
prog.cpp:172:29: note: ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ is not derived from ‘const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>’
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
^
prog.cpp:172:83: error: no match for ‘operator[]’ (operand types are ‘__gnu_cxx::__alloc_traits<std::allocator<std::vector<long unsigned int> > >::value_type {aka std::vector<long unsigned int>}’ and ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’)
std::cout << std::get<0>(o) << ',' << std::get<1>(o) << ',' << M[std::get<1>(o)][std::get<0>(o)] << std::endl;
^
In file included from /usr/include/c++/6/vector:64:0,
from prog.cpp:2:
/usr/include/c++/6/bits/stl_vector.h:780:7: note: candidate: std::vector<_Tp, _Alloc>::reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>; std::vector<_Tp, _Alloc>::reference = long unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
operator[](size_type __n) _GLIBCXX_NOEXCEPT
^~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:780:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘std::vector<long unsigned int>::size_type {aka long unsigned int}’
/usr/include/c++/6/bits/stl_vector.h:795:7: note: candidate: std::vector<_Tp, _Alloc>::const_reference std::vector<_Tp, _Alloc>::operator[](std::vector<_Tp, _Alloc>::size_type) const [with _Tp = long unsigned int; _Alloc = std::allocator<long unsigned int>; std::vector<_Tp, _Alloc>::const_reference = const long unsigned int&; std::vector<_Tp, _Alloc>::size_type = long unsigned int]
operator[](size_type __n) const _GLIBCXX_NOEXCEPT
^~~~~~~~
/usr/include/c++/6/bits/stl_vector.h:795:7: note: no known conversion for argument 1 from ‘std::__tuple_element_t<0ul, std::tuple<std::tuple<long int, long int>, long unsigned int, long unsigned int, long unsigned int> > {aka std::tuple<long int, long int>}’ to ‘std::vector<long unsigned int>::size_type {aka long unsigned int}’