Please read the new rule regarding the restriction on the use of AI tools. ×

Gordon-Freeman's blog

By Gordon-Freeman, history, 4 hours ago, In English

Can someone explain to me how do we choose ranges when doing BinarySearch i solved a lot of BS problems but to be honest i alwayes try differnt ways until one of them work... by mean whats the diffence between writing while(l<r) and while(l<=r) and while(l+1<r)...etc and when do we set r=mid and when r=mid-1 and same for l , please someone explain them all this is the only thing confuse me at BS problems

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it

By Gordon-Freeman, history, 5 weeks ago, In English

Can someone tell me why i got TLE on this problem: 2004D - Colored Portals i saw a lot of solution using BS so why mine won't pass and how can i improve it, here is my sub 276828392

Full text and comments »

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

By Gordon-Freeman, history, 2 months ago, In English

If i have a sorted vector like this v={ 5,6,7,8,9,10,11 } how can i get the number of elements that are bigger than x? lets say x is 9 so the number of elements bigger than 9 equals 2 how can i code that?

Full text and comments »

  • Vote: I like it
  • +6
  • Vote: I do not like it

By Gordon-Freeman, history, 4 months ago, In English

i was solving this problem from the last div4 1971E - Find the Car and here is my submisson: 260566589 — i'am getting WA in testcase 19 and i found out it's because i'am using (double) , why is that can someone explain?

Full text and comments »

  • Vote: I like it
  • +1
  • Vote: I do not like it