You are not logged in. Please login at to post your questions!


Need help in SPOJ 2DSORT

I am trying to solve SORT2D, the approach I am thinking of is using a vector<pair<int,int>> v and then sort(v.begin(),v.end() but then how do I compare the y co-ordinate's position when x values are equal?

asked 23 Feb '18, 22:43

montycs's gravatar image

accept rate: 0%

you have to use comparator here, you can read about it here
This code can help.


answered 23 Feb '18, 23:39

siddharthp538's gravatar image

accept rate: 11%

edited 23 Feb '18, 23:40

toggle preview

Follow this question

By Email:

Once you sign in you will be able to subscribe for any updates here



Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text]( "title")
  • image?![alt text](/path/img.jpg "title")
  • numbered list: 1. Foo 2. Bar
  • to add a line break simply add two spaces to where you would like the new line to be.
  • basic HTML tags are also supported
  • mathemetical formulas in Latex between $ symbol

Question tags:


question asked: 23 Feb '18, 22:43

question was seen: 156 times

last updated: 23 Feb '18, 23:40