当我编写long long sum = accumulate(a.begin(), a.end(), 0);或long long sum = accumulate(a.begin(), a.end(), 0ll);时,都会得到相同的结果,那么为什么要使用0ll而不是只使用0 (其中a是std:: vector<int> a(n))呢?
在Matlab中,[C, ia, ic] = unique(A)函数返回一个排序数组C,其中删除了A中的重复项,ia和ic数组包含索引,使得C = A(ia) and A = C(ic)。indices are incremented by 1 to accomodate the C++ convection.
ia = [4, 3, 7, 0, 1, 2, 8]; % size(ia{1, 2, 3, -1, -2, 0, 0, 0