foo.cc: In function 'bool cmp(std::__cxx11::string, std::__cxx11::string)':
foo.cc:10:19: warning: array subscript has type 'char' [-Wchar-subscripts]
if(k && pos[a[i]] > pos[b[i]]) return false;
^
foo.cc:10:31: warning: array subscript has type 'char' [-Wchar-subscripts]
if(k && pos[a[i]] > pos[b[i]]) return false;
^
foo.cc:11:20: warning: array subscript has type 'char' [-Wchar-subscripts]
if(!k && pos[a[i]] < pos[b[i]]) return false;
^
foo.cc:11:32: warning: array subscript has type 'char' [-Wchar-subscripts]
if(!k && pos[a[i]] < pos[b[i]]) return false;
^
foo.cc: In function 'int main()':
foo.cc:18:19: warning: comparison between signed and unsigned integer expressions [-Wsign-compare]
for(int i = 0; i < str1.size(); i++) pos[str1[i]] = i;
~~^~~~~~~~~~~~~
foo.cc:18:50: warning: array subscript has type 'char' [-Wchar-subscripts]
for(int i = 0; i < str1.size(); i++) pos[str1[i]] = i;
^
[Hydro](https://hydro.ac)提供评测服务