vector<int>&F1(){
// do sth. then return a vector// e.g. return vector<int>(114514);
}
vector<int>F2() {
// do sth. then return a vector// e.g. return vector<int>(114514);
}
voidF3(vector<int>&a){
// do sth. and let a be it.// e.g. a=vector<int>(114514);
}
voidsolve(){
vector<int>&a=F1();
vector<int>b=F2();
vector<int>c;F3(c);
// do sth. with the vector
}
萌新求教,我想使用 F 函数接受一个长度较大的 vector 并对收到的 vector 做大量操作,上述代码片段的三种写法哪一种“常数”更小