Problem code : TAXITURN
Problem : https://www.codechef.com/problems/TAXITURN
Language used : C++
My code: https://www.codechef.com/viewsolution/18839155
Some comments to my code that I missed:
- I used the formula angle between two vectors a and b = cosinverse[(a vector. b vector)/ab].
- 22.0/28 = pi/4 = 45 degrees.
Please tell me why my code is wrong. I tried the sample input given in the problem with my g++ compiler and it worked fine.
Also I appreciate any advice to improve my programming.
EDIT:
I seem to have not ensured that the coordinates I change to are different from the rest and I also had not given enough size for the array to store the coordinates. I corrected it but still I’m getting wrong answer.
So this is my UPDATED CODE : https://www.codechef.com/viewsolution/18874035
I’ve also made it more easy to read. I would be glad if you could go though my code and spot the error I made.
I wish I knew what input code chef was using, if I knew that I know that I can definitely find the error. The code works fine for the sample input given in the problem page.