addict_0x0F's blog

By addict_0x0F, history, 45 hours ago, In English

I have been trying to solve this Problem F. Here i am using set of custom data as below

struct data{
    ll x,y;
    int n;
    bool operator()(const data& a, const data& b){
        return (a.x==b.x)?(a.y<b.y):(a.x<b.x);
    }
    friend bool operator < (const data& a, const data& b){
        return (a.x==b.x)?(a.y<b.y):(a.x<b.x);
    }
    friend bool operator > (const data& a, const data& b){
        return (a.x==b.x)?(a.y>b.y):(a.x>b.x);
    }
};
set<data> st;

I am doing Insert, erase, lower_bound operation on this set. which is working fine on my Ubantu, but giving compilation error as "template argument 1 is invalid". The problem is in the set data structure so tried to debug it from this stackoverflow thread,tried to subit it in different c++ virsions too,but none of them is working,(some of it are working fine on my machine, but not on atcoder judge.

My submissions one. and another implementation of set::comp()

HELP Thanks in Advance;

Full text and comments »

  • Vote: I like it
  • 0
  • Vote: I do not like it