Rope用法
rope 可持續化平衡樹
// 頭文件 #include <ext/rope> using namespace __gnu_cxx; rope<int> a; rope<char> a; a.push_back(x) // 在末尾插入 a.pop_back(x) // 刪除最后一個元素 a.size() // 返回長度 a.insert(int pos, x) // 在pos插入x a.erase(int pos, int sum) // 在pos刪除sum個元素 a.replace(int pos, x) // 將pos替換為x a.substr(int pos, int sum) // 在pos處截取sum個元素 a.at(x) a[x] //訪問第x個元素總結
- 上一篇: 牛客网暑期ACM多校训练营(第三场)H
- 下一篇: kali 安装搜狗输入法