permutation.cpp: In function 'std::string operator*(std::string, std::string)':
permutation.cpp:21:31: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
21 | for (int i = 0;i < d;i++) a += 0;
| ~~^~~~
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from permutation.cpp:2:
/usr/include/c++/9/bits/basic_string.h:1168:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1168 | operator+=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1177:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1177 | operator+=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1186:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1186 | operator+=(_CharT __c)
| ^~~~~~~~
permutation.cpp:24:31: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
24 | for (int i = 0;i < d;i++) b += 0;
| ~~^~~~
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from permutation.cpp:2:
/usr/include/c++/9/bits/basic_string.h:1168:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1168 | operator+=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1177:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1177 | operator+=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1186:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1186 | operator+=(_CharT __c)
| ^~~~~~~~
permutation.cpp:29:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
29 | for (int i = 0;i < a.size();i++) {
| ~~^~~~~~~~~~
permutation.cpp:35:15: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
35 | if (tmp) ret += 0;
| ~~~~^~~~
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from permutation.cpp:2:
/usr/include/c++/9/bits/basic_string.h:1168:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1168 | operator+=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1177:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1177 | operator+=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1186:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1186 | operator+=(_CharT __c)
| ^~~~~~~~
permutation.cpp: In function 'std::string operator/(std::string, std::string)':
permutation.cpp:41:30: error: ambiguous overload for 'operator+=' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'int')
41 | for (int i = 0;i < d;i++) b += 0;
| ~~^~~~
In file included from /usr/include/c++/9/string:55,
from /usr/include/c++/9/bits/locale_classes.h:40,
from /usr/include/c++/9/bits/ios_base.h:41,
from /usr/include/c++/9/ios:42,
from /usr/include/c++/9/ostream:38,
from /usr/include/c++/9/iostream:39,
from permutation.cpp:2:
/usr/include/c++/9/bits/basic_string.h:1168:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const std::__cxx11::basic_string<_CharT, _Traits, _Alloc>&) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1168 | operator+=(const basic_string& __str)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1177:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(const _CharT*) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1177 | operator+=(const _CharT* __s)
| ^~~~~~~~
/usr/include/c++/9/bits/basic_string.h:1186:7: note: candidate: 'std::__cxx11::basic_string<_CharT, _Traits, _Alloc>& std::__cxx11::basic_string<_CharT, _Traits, _Alloc>::operator+=(_CharT) [with _CharT = char; _Traits = std::char_traits<char>; _Alloc = std::allocator<char>]'
1186 | operator+=(_CharT __c)
| ^~~~~~~~
permutation.cpp:44:19: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
44 | for (int i = 0;i < a.size();i++) {
| ~~^~~~~~~~~~
permutation.cpp: In function 'int main()':
permutation.cpp:118:20: error: operands to ?: have different types 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char'
118 | b[i] = q[i] / (i ? q[i - 1] : char(0));
| ~~^~~~~~~~~~~~~~~~~~~~
permutation.cpp:119:25: error: no match for 'operator*' (operand types are 'std::string' {aka 'std::__cxx11::basic_string<char>'} and 'char')
119 | c[i] = (i ? (q[i - 1] * char(1)) / b[i] : char(0));
| ~~~~~~~~ ^ ~~~~~~~
| | |
| | char
| std::string {aka std::__cxx11::basic_string<char>}
permutation.cpp:17:8: note: candidate: 'std::string operator*(std::string, std::string)'
17 | string operator *(string a, string b) { //addition
| ^~~~~~~~
permutation.cpp:17:36: note: no known conversion for argument 2 from 'char' to 'std::string' {aka 'std::__cxx11::basic_string<char>'}
17 | string operator *(string a, string b) { //addition
| ~~~~~~~^