ENG  RUSTimus Online Judge
Online Judge
Problems
Authors
Online contests
About Online Judge
Frequently asked questions
Site news
Webboard
Links
Problem set
Submit solution
Judge status
Guide
Register
Update your info
Authors ranklist
Current contest
Scheduled contests
Past contests
Rules
back to board

Common Board

Problems with comparator
Posted by wRabbits_AlMag(VNTU) 28 Feb 2010 12:38
Hi.
I'm using :) such a construction in my code

struct maxY {
    bool operator () (const int& n1, const int& n2) {
              // compare something
    }
};

...

set<int, maxY> s;

in my VS 2009 it's ok, but Online Judge says it's a compilation error. Help to fix, please.
Re: Problems with comparator
Posted by SuperLight 28 Feb 2010 13:14
Re: Problems with comparator
Posted by wRabbits_AlMag(VNTU) 7 Mar 2010 00:38
Oh, yeah, thanks :)
Any other thoughts?
Re: Problems with comparator
Posted by wRabbits_AlMag(VNTU) 7 Mar 2010 15:39
I've got, what's the problem.

bool operator()(int t1, int t2)const {
...
}

should be written