dna.cpp: In function 'int get_distance(int, int)':
dna.cpp:20:11: error: 'string' was not declared in this scope
20 | std::map<string,int>mp;
| ^~~~~~
dna.cpp:20:11: note: suggested alternatives:
In file included from /usr/include/c++/10/string:39,
from dna.h:1,
from dna.cpp:1:
/usr/include/c++/10/bits/stringfwd.h:79:33: note: 'std::string'
79 | typedef basic_string<char> string;
| ^~~~~~
In file included from dna.h:1,
from dna.cpp:1:
/usr/include/c++/10/string:67:11: note: 'std::pmr::string'
67 | using string = basic_string<char>;
| ^~~~~~
dna.cpp:20:21: error: template argument 1 is invalid
20 | std::map<string,int>mp;
| ^
dna.cpp:20:21: error: template argument 3 is invalid
dna.cpp:20:21: error: template argument 4 is invalid
dna.cpp:21:4: error: no match for 'operator[]' (operand types are 'int' and 'std::pmr::string' {aka 'std::__cxx11::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char> >'})
21 | mp[s]=1;
| ^
dna.cpp:22:13: error: 'pair' was not declared in this scope; did you mean 'std::pair'?
22 | std::queue<pair<int,int>>q;
| ^~~~
| std::pair
In file included from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/string:40,
from dna.h:1,
from dna.cpp:1:
/usr/include/c++/10/bits/stl_pair.h:211:12: note: 'std::pair' declared here
211 | struct pair
| ^~~~
dna.cpp:22:25: error: template argument 1 is invalid
22 | std::queue<pair<int,int>>q;
| ^~
dna.cpp:22:25: error: template argument 2 is invalid
dna.cpp:23:4: error: request for member 'push' in 'q', which is of non-class type 'int'
23 | q.push({s,1});
| ^~~~
dna.cpp:24:11: error: request for member 'empty' in 'q', which is of non-class type 'int'
24 | while(!q.empty()){
| ^~~~~
dna.cpp:25:24: error: request for member 'front' in 'q', which is of non-class type 'int'
25 | std::pmr::string a=q.front().ff;
| ^~~~~
dna.cpp:26:11: error: request for member 'front' in 'q', which is of non-class type 'int'
26 | int w=q.front().ss;
| ^~~~~
dna.cpp:30:5: error: request for member 'pop' in 'q', which is of non-class type 'int'
30 | q.pop();
| ^~~
dna.cpp:31:16: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
31 | for(int i=0;i<a.size();i++){
| ~^~~~~~~~~
dna.cpp:32:17: warning: comparison of integer expressions of different signedness: 'int' and 'std::__cxx11::basic_string<char, std::char_traits<char>, std::pmr::polymorphic_allocator<char> >::size_type' {aka 'long unsigned int'} [-Wsign-compare]
32 | for(int j=0;j<a.size();j++){
| ~^~~~~~~~~
dna.cpp:33:11: error: expected ';' before 'tmp'
33 | string tmp=a;
| ^~~~
| ;
dna.cpp:34:10: error: 'tmp' was not declared in this scope; did you mean 'mp'?
34 | swap(tmp[i],tmp[j]);
| ^~~
| mp
dna.cpp:34:5: error: 'swap' was not declared in this scope
34 | swap(tmp[i],tmp[j]);
| ^~~~
dna.cpp:34:5: note: suggested alternatives:
In file included from /usr/include/c++/10/regex:62,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:110,
from dna.cpp:2:
/usr/include/c++/10/bits/regex.h:2141:5: note: 'std::__cxx11::swap'
2141 | swap(match_results<_Bi_iter, _Alloc>& __lhs,
| ^~~~
In file included from /usr/include/c++/10/bits/stl_pair.h:59,
from /usr/include/c++/10/bits/stl_algobase.h:64,
from /usr/include/c++/10/bits/char_traits.h:39,
from /usr/include/c++/10/string:40,
from dna.h:1,
from dna.cpp:1:
/usr/include/c++/10/bits/move.h:189:5: note: 'std::swap'
189 | swap(_Tp& __a, _Tp& __b)
| ^~~~
/usr/include/c++/10/bits/move.h:189:5: note: 'std::swap'
In file included from /usr/include/c++/10/exception:147,
from /usr/include/c++/10/new:41,
from /usr/include/c++/10/ext/new_allocator.h:33,
from /usr/include/x86_64-linux-gnu/c++/10/bits/c++allocator.h:33,
from /usr/include/c++/10/bits/allocator.h:46,
from /usr/include/c++/10/string:41,
from dna.h:1,
from dna.cpp:1:
/usr/include/c++/10/bits/exception_ptr.h:169:5: note: 'std::__exception_ptr::swap'
169 | swap(exception_ptr& __lhs, exception_ptr& __rhs)
| ^~~~
In file included from /usr/include/c++/10/filesystem:45,
from /usr/include/x86_64-linux-gnu/c++/10/bits/stdc++.h:129,
from dna.cpp:2:
/usr/include/c++/10/bits/fs_path.h:658:15: note: 'std::filesystem::__cxx11::swap'
658 | inline void swap(path& __lhs, path& __rhs) noexcept { __lhs.swap(__rhs); }
| ^~~~
dna.cpp:37:8: error: request for member 'push' in 'q', which is of non-class type 'int'
37 | q.push({tmp,w+1});
| ^~~~