here is the link to the problem
on simple iteration i am getting tle
using inclusion and exclusion i am getting wrong answer,
please help me with the solution of the problem.
Easy math spoj problem
@ankitkumarmbill1 hey you have to use maths logic,here is code for reference:
https://sapphireengine.com/@/1wbya9
ok thank you i understood your logic,but your code is not giving correct answer for all the sample test cases.sample test case can be found on the same link which i have mentioned in the previous chat.
I hope I’ve cleared your doubt. I ask you to please rate your experience here
Your feedback is very important. It helps us improve our platform and hence provide you
the learning experience you deserve.
On the off chance, you still have some questions or not find the answers satisfactory, you may reopen
the doubt.
your code is giving output as 5, 54, 528 whereas correct output is 5, 54, 543. I also tried to submit your code but the judge is also showing wrong answer.
i tried new code but it is also giving wrong .
i am not getting what you are asking.
nhi ek hi hai ek aur hai lekin uska naam hai not-so-easy-math and this one is easy-math
@ankitkumarmbill1 bro ye wala soln jo mene pehle bhi bheja tha ye chal rha hai and mene khud submit kia hai so please check it again:
https://ideone.com/30HKr3
Bhaiya can you send the link of the question to which you are submitting the solution.
ya the new code which you sent is working. Can you please explain the use of bitmask and lcm1 inside nested for loop line no, around 29 30 31…