mr_dreamer's blog

By mr_dreamer, history, 5 years ago, In English
  • Vote: I like it
  • +3
  • Vote: I do not like it

»
5 years 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

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

    thanks mr linesekarenge

  • »
    »
    5 years 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.

    • »
      »
      »
      5 years 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