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

Discussion of Problem 1175. Strange Sequence

Strange...
Posted by Alias (Alexander Prudaev) 10 Apr 2007 21:51
I have two programs 1st - a right one wich have WA#2
and second - gets AC

if you remove comment you get WA#2
WHY? I realy can't understand, anybody please help me!

struct point
{
    int ID;
    double x,y;
};

int Chet(point a)
{
//    if (a.x > 0 && a.y >=0)
        return 0;
//    if (a.x <=0 && a.y > 0)
//        return 1;
//    if (a.x < 0 && a.y <=0)
//        return 2;
//    if (a.x >=0 && a.y < 0)
//        return 3;
}

inline bool Tr(const point &a, const point &b)
{
    return a.x*b.y-a.y*b.x > 0;
}

inline bool operator < (const point &a, const point &b)
{
    int ca = Chet(a);
    int cb = Chet(b);
    return ca < cb || ca==cb && Tr(a,b);
}
Re: Strange...
Posted by Alias (Alexander Prudaev) 10 Apr 2007 21:58
Oh sorry, I mean problem 1175, admins you can correct it