Блог пользователя devarshi09

Автор devarshi09, история, 6 лет назад, По-английски

I am getting WA in Spoj Problem ,Build the fence . Link to the problem : https://www.spoj.com/problems/BSHEEP/ Link to my code : https://ideone.com/NpcblK . Can anyone help me to find the error or give any counter test case. I used graham scan algorithm to make my code efficient.

  • Проголосовать: нравится
  • 0
  • Проголосовать: не нравится

»
6 лет назад, # |
  Проголосовать: нравится +14 Проголосовать: не нравится

Lmao are you fucking kidding me. You say like two words about your solution. Do you even expect someone to answer?

Your code is filled with crappy shorthands which are impossible to parse for anyone else. What is more, your code is not even indented properly.

How do you even think someone is going to parse what you might mean by

bool cmp(pair<int,pair<int,int> > a,pair<int,pair<int,int> > b){
    if(a.se.se==b.se.se && a.se.fi!=b.se.fi) return a.se.fi<b.se.fi;
    if(a.se.fi==b.se.fi) return a.fi<b.fi;
    return a.se.se<b.se.se;
}

or maybe

a.fi=pts[0].fi;
a.se.se=pts[0].se.se;
a.se.fi=pts[0].se.fi;
 
b.fi=pts[n-1].fi;
b.se.se=pts[n-1].se.se;
b.se.fi=pts[n-1].se.fi;