Problem fractions
User pIaceholder
Submission Time 2023-06-21 10:58:02
Score 0
Max Time N/A
Max Memory N/A

Compile Error

fractions.cpp: In function ‘int main()’:
fractions.cpp:18:100: error: no matching function for call to ‘std::vector<std::pair<long double, std::__cxx11::basic_string<char> > >::insert(<brace-enclosed initializer list>)’
18 | res.insert({(long double) a / (long double) b, std::to_string(a) + " " + std::to_string(b)});
| ^
In file included from /usr/include/c++/9/vector:72,
from fractions.cpp:2:
/usr/include/c++/9/bits/vector.tcc:130:5: note: candidate: ‘std::vector<_Tp, _Alloc>::iterator std::vector<_Tp, _Alloc>::insert(std::vector<_Tp, _Alloc>::const_iterator, const value_type&) [with _Tp = std::pair<long double, std::__cxx11::basic_string<char> >; _Alloc = std::allocator<std::pair<long double, std::__cxx11::basic_string<char> > >; std::vector<_Tp, _Alloc>::ite