zakwan_hasan's blog

By zakwan_hasan, history, 6 weeks ago, In English,
 
 
 
 
  • Vote: I like it
  • +3
  • Vote: I do not like it

»
6 weeks ago, # |
  Vote: I like it 0 Vote: I do not like it

you were not checking condition of empty stack accepted solution: https://www.codechef.com/viewsolution/29828582

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it +8 Vote: I do not like it

    thanks mr linesekarenge

  • »
    »
    6 weeks ago, # ^ |
      Vote: I like it 0 Vote: I do not like it

    is it possible that the stack will empty ? because the the first element will always in the stack.

    • »
      »
      »
      6 weeks ago, # ^ |
        Vote: I like it 0 Vote: I do not like it

      If all points are distinct then obviously stack will never be empty. But if they are not then your ccw function will return 0, if any two points of triangle are same. Which may lead to empty stack