+ 7
[SOLVED] Stuck In a Problem !
I was Solving a problem on Codechef , I tried a lot to this problem But , i havent passed all of its test cases , I think that there is Some logical error in that : I need Your help Now , Help me @ https://github.com/Aaditay/Code-Chef-problem Also @ https://code.sololearn.com/cakFu1x6fEU5/?ref=app
11 ответов
+ 15
You have forgot to consider the move of mrs as if mr will move c units then mrs will move d units and if mr will move d units then mrs will move c units.
basic solution will be checking (a-b)%(c-d)==0, there is no need to take absolute values, probably users using it for their own clarity of different cases like mrs ahead, mr ahead along with combination of c>d or d>c.
also, firstly don't forget to check whether c==d as if it is true and a!=b then they will never meet, as modulus with 0 is not defined.
Abhijeet Kumar
fails for:
1
1 1 2 2
+ 5
Can you put your code in SoloLearn and link it here?
+ 4
+ 4
Gaurav Agrawal Thanks for finding the loop hole in code
See the code now I have rectified that problem 😁
0
hi i saw the problem here and i think i
0
Pardon
0
Please teach me how to code with python
0
Precious Ikechukwu As i can see You have started python tutorial on Sololearn ,, So learn from there ,, And dont forget to practice
Also after Completing the Course i would recommend you to "Python Crash Course Book" ....
You can download its free pdf format from libgen.is
0
Thanks
0
I'm about to take IT Whizkid Competition