You are not logged in. Please login at www.codechef.com 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

0★montycs
1057
accept rate: 0%


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

link

answered 23 Feb '18, 23:39

siddharthp538's gravatar image

4★siddharthp538
2555
accept rate: 11%

edited 23 Feb '18, 23:40

toggle preview
Preview

Follow this question

By Email:

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

By RSS:

Answers

Answers and Comments

Markdown Basics

  • *italic* or _italic_
  • **bold** or __bold__
  • link:[text](http://url.com/ "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:

×1,137

question asked: 23 Feb '18, 22:43

question was seen: 156 times

last updated: 23 Feb '18, 23:40