跳到正文

算法·理论

常识

gmb729约 1 分钟
原文
文章信息与版本

文章信息

发布
2023年12月23日
收录
2025年12月12日
更新
2026年11月18日
篇幅
约 1 分钟

版本

  1. v1当前
C++
//在vector为空的时候
vetor<int> z;
cout<<z.size()-1;//无限大
int y=z.size();
cout<<y-1;//-1

vector<pair<int,int> > z;
z.push({1,2});
for(auto it:z){//c++11以上
    cout<<x.first<<" "<<x.second<<endl;
}
for(auto [u,v,...]:z){//c++17以上
    cout<<u<<" "<<v<<" "<<...<<endl;
}


freopen("bus.in","r",stdin);//文件读写
freopen("bus.out","w",stdout);


    

https://oi-wiki.org/lang/csl/associative-container/ 将n个元素分成m堆=C(n-i-m-2,m-2)(i取1~n-m-2)

原文