+ 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

6th Mar 2020, 10:31 AM
Monkey D. Luffy
Monkey D. Luffy - avatar
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
6th Mar 2020, 3:48 PM
Gaurav Agrawal
Gaurav Agrawal - avatar
+ 5
Can you put your code in SoloLearn and link it here?
6th Mar 2020, 10:35 AM
Lothar
Lothar - avatar
6th Mar 2020, 10:44 AM
Monkey D. Luffy
Monkey D. Luffy - avatar
+ 4
Gaurav Agrawal Thanks for finding the loop hole in code See the code now I have rectified that problem 😁
6th Mar 2020, 5:27 PM
Abhijeet Kumar
Abhijeet Kumar - avatar
6th Mar 2020, 3:34 PM
Abhijeet Kumar
Abhijeet Kumar - avatar
0
hi i saw the problem here and i think i
7th Mar 2020, 4:34 PM
Koushik G.S
Koushik G.S - avatar
0
Pardon
7th Mar 2020, 6:59 PM
tinashejoey
tinashejoey - avatar
0
Please teach me how to code with python
7th Mar 2020, 7:50 PM
Precious Ikechukwu
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
8th Mar 2020, 1:01 AM
Monkey D. Luffy
Monkey D. Luffy - avatar
0
Thanks
8th Mar 2020, 5:58 AM
Precious Ikechukwu
0
I'm about to take IT Whizkid Competition
8th Mar 2020, 5:59 AM
Precious Ikechukwu