STL的vector可用
max_element( , )
std::max_element 定义于头文件 <algorithm> 寻找范围 [first, last) 中的最大元素的下标。
解引用可得最大的元素值
*max_element(candies.begin(), candies.end())
push_back()
ret.push_back()
容器用push_back向尾插入;
如果创建vector容器是没指定大小,不能用ret[i] = val;
否则显示
runtime error: store to null pointer of type 'std::_Bit_type' (aka 'unsigned long') (stl_bvector.h)