Created
February 19, 2020 07:20
-
-
Save Privilger/e8322ccf5dccc7005dcf7adce470e9c9 to your computer and use it in GitHub Desktop.
C++ STL 使用技巧
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/* | |
元素去重 | |
*/ | |
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