Skip to content

Instantly share code, notes, and snippets.

@yizhengzhang1
Created February 19, 2020 07:20
Show Gist options
  • Select an option

  • Save yizhengzhang1/e8322ccf5dccc7005dcf7adce470e9c9 to your computer and use it in GitHub Desktop.

Select an option

Save yizhengzhang1/e8322ccf5dccc7005dcf7adce470e9c9 to your computer and use it in GitHub Desktop.
C++ STL 使用技巧
/*
元素去重
*/
vector<int> alls; //存储所有值
sort(alls.begin(), alls.end()); //排序
alls.erase(unique(alls.begin(), alls.end()), alls.end()); //去除重复元素
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment