正文
增加 4 行删除 4 行
23 行未改动24252627282930313233347 行未改动42434445464748495017 行未改动68697071727374757625 行未改动23 行未改动`std::partial_sum` 也可以重载加法运算,使用方法如下,在此不再赘述。```cpptemplate <class InputIterator, class OutputIterator, class BinaryOperation>OutputIterator partial_sum (InputIterator first,InputIterator last,OutputIterator result,BinaryOperation binary_op);```# 代码7 行未改动namespace IO {inline int read() {int x = 0, f = 1; char ch = getchar();while(ch > '9' || ch < '0') {if(ch == '-') f = -1;ch = getchar();}while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch - 48), ch = getchar();return x * f;17 行未改动a.push_back(tmp);}cnt.resize(a.size());std::partial_sum(a.begin(), a.end(), cnt.begin());IO::write(*cnt.rbegin());return 0;}```25 行未改动23 行未改动24252627282930313233347 行未改动42434445464748495017 行未改动68697071727374757625 行未改动23 行未改动`std::partial_sum` 也可以重载加法运算,使用方法如下,在此不再赘述。```cpptemplate <class InputIterator, class OutputIterator, class BinaryOperation>OutputIterator partial_sum (InputIterator first,InputIterator last,OutputIterator result,BinaryOperation binary_op);```# 代码7 行未改动namespace IO {inline int read() {int x = 0, f = 1; char ch = getchar();while(ch > '9' || ch < '0') {if(ch == '-') f = -1;ch = getchar();}while(ch >= '0' && ch <= '9') x = (x << 3) + (x << 1) + (ch - 48), ch = getchar();return x * f;17 行未改动a.push_back(tmp);}cnt.resize(a.size());std::partial_sum(a.begin(), a.end(), cnt.begin());IO::write(*cnt.rbegin());return 0;}```25 行未改动