fork download
  1. #include <iostream>
  2. #include <algorithm>
  3. #include <vector>
  4. #include <utility>
  5. using namespace std;
  6.  
  7.  
  8. int N;
  9.  
  10. int main() {
  11. // your code goes here
  12. scanf("%d",&N);
  13. vector<pair<int,int>> points(N);
  14. for(int i=0;i<N;i++)
  15. scanf("%d %d",&points[i].first,&points[i].second);
  16. sort(points.begin(),points.end());
  17. for(int i=0;i<N;i++)
  18. printf("%d %d\n",points[i].first,points[i].second);
  19. return 0;
  20. }
Success #stdin #stdout 0s 15240KB
stdin
5
3 4
1 1
1 -1
2 2
3 3
stdout
1 -1
1 1
2 2
3 3
3 4