STL-unordered

This commit is contained in:
e2hang
2025-08-13 17:54:58 +08:00
parent 120db9b163
commit 46d96dff5c
2 changed files with 60 additions and 0 deletions

View File

@@ -0,0 +1,20 @@
//<2F>÷<EFBFBD><C3B7><EFBFBD>unordered_map - multimapһ<70><D2BB>
#include <unordered_map>
#include <iostream>
using namespace std;
int main(){
unordered_multimap<int, int> m;
m.insert({make_pair(1,111), make_pair(2,222), make_pair(3,333), make_pair(8,888), make_pair(6,666), make_pair(5,555)});
m.insert({make_pair(1,11), make_pair(2,22), make_pair(1,1)});
cout << m.count(1) << " " << m.find(1)->first << "," << m.find(1)->second << endl;
m.erase(m.find(1));
cout << m.count(1) << " " << m.find(1)->first << "," << m.find(1)->second << endl;
m.erase(1);
cout << m.count(1) << endl;
return 0;
}
/*
3 1,1
2 1,11
0
*/