foo.cc: In function 'std::string bigIntToStr(BigInt)':
foo.cc:26:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
26 | for (int i = 0; i < num.size(); i++) {
| ~~^~~~~~~~~~~~
foo.cc: In function 'BigInt add(BigInt, BigInt)':
foo.cc:39:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
39 | for (int i = 0; i < a.size() || i < b.size(); i++) {
| ~~^~~~~~~~~~
foo.cc:39:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
39 | for (int i = 0; i < a.size() || i < b.size(); i++) {
| ~~^~~~~~~~~~
foo.cc:41:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
41 | if (i < a.size()) tmp += a[i];
| ~~^~~~~~~~~~
foo.cc:42:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
42 | if (i < b.size()) tmp += b[i];
| ~~^~~~~~~~~~
foo.cc: In function 'BigInt sub(BigInt, BigInt)':
foo.cc:53:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
53 | for (int i = 0; i < a.size() || i < b.size(); i++) {
| ~~^~~~~~~~~~
foo.cc:53:39: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
53 | for (int i = 0; i < a.size() || i < b.size(); i++) {
| ~~^~~~~~~~~~
foo.cc:55:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
55 | if (i < a.size()) tmp += a[i];
| ~~^~~~~~~~~~
foo.cc:56:15: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
56 | if (i < b.size()) tmp -= b[i];
| ~~^~~~~~~~~~
foo.cc: In function 'BigInt mul(BigInt, int)':
foo.cc:72:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
72 | for (int i = 0; i < a.size(); i++) {
| ~~^~~~~~~~~~
foo.cc: In function 'BigInt mul(BigInt, BigInt)':
foo.cc:83:23: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
83 | for (int i = 0; i < a.size(); i++) {
| ~~^~~~~~~~~~
foo.cc:85:27: warning: comparison of integer expressions of different signedness: 'int' and 'std::vector<int>::size_type' {aka 'long unsigned int'} [-Wsign-compare]
85 | for (int j = 0; j < b.size(); j++) {
| ~~^~~~~~~~~~
foo.cc: In function 'BigInt div(BigInt, BigInt, BigInt&)':
foo.cc:123:16: error: reference to 'less' is ambiguous
123 | while (less(b, r)) {
| ^~~~
In file included from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/string:48,
from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/bits/locale_classes.h:40,
from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/bits/ios_base.h:41,
from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/ios:42,
from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/ostream:38,
from /nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/iostream:39,
from foo.cc:1:
/nix/store/wy4ywjsch9q2hj5lphqjdg9p2kf7w0ls-gcc-11.3.0/include/c++/11.3.0/bits/stl_function.h:395:12: note: candidates are: 'template<class _Tp> struct std::less'
395 | struct less : public binary_function<_Tp, _Tp, bool>
| ^~~~
foo.cc:96:6: note: 'bool less(BigInt, BigInt)'
96 | bool less(BigInt a, BigInt b) {
| ^~~~
[Hydro](https://hydro.ac)提供评测服务