测试用例


C++常用库函数

标签(空格分隔): C++ LeetCode 面试


cctype

isalnum isalpha isdigit islower isspace isupper isxdigit toupper tolower

cmath

partial_sum

描述: Assigns to every element in the range starting at result the partial sum of the corresponding elements in the range 示例

class NumArray {
public:
    NumArray(vector<int> &nums) : psum(nums.size()+1, 0) {
        partial_sum( nums.begin(), nums.end(), psum.begin()+1);
    }

    int sumRange(int i, int j) {
        return psum[j+1] - psum[i];
    }
private:
    vector<int> psum;    
};

$$I*W ≈ (I ⊕ B) α\quad B∈\{+1, -1\}^{c×w×h}$$