344. Reverse String Write a function that takes a string as input and returns the string reversed. Example: Given s = "hello", return "olleh". class Solution { public: string reverseString(string s) { string::size_type i, j; if (s.size…
CODE FESTIVAL 2017 qual B B - Problem Set 确实水题,但当时没想到map,用sort后逐个比较解决的,感觉麻烦些,虽然效率高很多.map确实好写点. 用map: #include<iostream> #include<cstdio> #include<cstdlib> #include<map> using namespace std; map<int,int>mp; int main() { int n,…