fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. int main() {
  5. int n = 10;
  6. map<int, vector<int> > mp;
  7. for(int i = 0 ; i < n ;i++)
  8. mp[i].push_back(i+10);
  9. for(auto it : mp){
  10. cout<<it.first<<" ";
  11. for(int i = 0 ; i < it.second.size() ; i++){
  12. cout<<it.second[i]<<" ";
  13. }
  14. cout<<endl;
  15. }
  16. return 0;
  17. }
Success #stdin #stdout 0s 4476KB
stdin
Standard input is empty
stdout
0 10 
1 11 
2 12 
3 13 
4 14 
5 15 
6 16 
7 17 
8 18 
9 19