Problem sort
User AaravRastogi
Submission Time 2025-12-03 14:38:21
Score 0
Max Time N/A
Max Memory N/A

Compile Error

sort.cpp: In function ‘int main()’:
sort.cpp:15:9: error: request for member ‘begin’ in ‘m’, which is of non-class type ‘std::pair<long long int, std::__cxx11::basic_string<char> > [n]’
15 | sort(m.begin(),m.end());
| ^~~~~
sort.cpp:15:19: error: request for member ‘end’ in ‘m’, which is of non-class type ‘std::pair<long long int, std::__cxx11::basic_string<char> > [n]’
15 | sort(m.begin(),m.end());
| ^~~
sort.cpp:17:36: error: no match for ‘operator<<’ (operand types are ‘std::ostream’ {aka ‘std::basic_ostream<char>’} and ‘std::pair<long long int, std::__cxx11::basic_string<char> >’)
17 | for (int j = 0; j < n; ++j){ cout << m[j] << ' ';}
| ~~~~ ^~ ~~~~
| | |
| | std::pair<long long int, std::__cxx11::basic_string&