fork download
  1. #include <bits/stdc++.h>
  2. using namespace std;
  3.  
  4. #define ll long long
  5. #define MAX_N 1000001
  6. #define mod 1000000007
  7.  
  8.  
  9.  
  10. int main(){
  11.  
  12. ios_base::sync_with_stdio(false);
  13. cin.tie(0); cout.tie(0);
  14. map<int, int> mp;
  15. for(pair<int, int> it:mp){
  16. cout << it.first << " " << it.second << endl;
  17. }
  18. for(auto it=mp.begin();it!=mp.end();it++){
  19. cout << (*it).first << " " << (*it).second << endl;
  20. }
  21. for(auto it=mp.rbegin();it != mp.rend();it++){
  22. cout << (*it).first << " " << (*it).second << endl;
  23. }
  24. }
  25.  
Success #stdin #stdout 0.01s 5284KB
stdin
Standard input is empty
stdout
Standard output is empty