note1. again!
ctrl + F + again! to find the problems that need a double check
hj7. casting
float i;
int j = (int) i;
hj9. unordered_set
unordered_set
reverse(str.begin(), str.end())
set.count©
set.insert©
hj46. sub string
string s;
s.substr(0, 3); // 3 is not included
hj58. sort vector
vector v;
sort(v.begin(), v.end());
hj2. getline
string array;
getline(cin, array); // this gets more than cin
hj5. ASCII
‘0’ is ASCII 48
‘A’ is ASCII 65
if (s[i] >= ‘0’ && s[i] <= ‘9’)
ans += base * ((int)(s[i]-55));
hj6. prime factor
again!
hj8. map
map<int, int> m;
map<int, int>::iterator it;
it = m.find(a);
m[a] = it->second + b;
it=m.begin(); it!=m.end();it++
hj15. bitset and binary
bitset<32> b(5);
int ans = b.count(); // number of bits that are set
// in this case ans = 2
hj21. password and string.find()
// don’t ever try to to_string(char) because it turns it into its ASCII value
// check https://www.geeksforgeeks.org/string-find-in-cpp/
hj22. a strange question
again!
hj23. a very good practice question
again!
hj31. how to reverse words in a string?
again!
hj35. sequence
2阶差的一半是n方的系数
hj37. fibonacci and breeding problem
again!
hj54. calculator
this is the hardest simple question, by far
again!
hj61. dynamic programming
again!
hj85. interesting question about 回文
hj86. bitset和更新最大值
hj94. nasty question, map and insertion order
needs a vector!
hj97. printf
hj102. research on this strange way to sort with a bool
again!