Lib/mapの全探索
code:cpp
for (auto iter = mp.begin(); iter != mp.end(); iter++) {
// first: key, second: value
cout << "key = " << iter->first << "\n";
cout << "value = " << iter->second << "\n";
}
C++17以降
code:cpp
map<int,int> mp;
for(auto a,b : mp){
//key = a,b = val
}
たぶんsetも同じ要領でいける と思う