We use cookies to ensure you have the best browsing experience on our website. Please read our cookie policy for more information about how we use cookies.
C src code without using for loop
scanf("%ld%ld%ld%ld",&x1,&v1,&x2,&v2);
if(v2>=v1)
printf("NO");
else
{
((x2-x1)%(v1-v2)!=0)?printf("NO"):printf("YES");
}
It has PASSED ALL TEST CASES. It will control time complexity.
Cookie support is required to access HackerRank
Seems like cookies are disabled on this browser, please enable them to open this website
Number Line Jumps
You are viewing a single comment's thread. Return to all comments →
C src code without using for loop scanf("%ld%ld%ld%ld",&x1,&v1,&x2,&v2); if(v2>=v1) printf("NO"); else { ((x2-x1)%(v1-v2)!=0)?printf("NO"):printf("YES"); }
It has PASSED ALL TEST CASES. It will control time complexity.