last night codeforces contest round question A,
what mistake in this algorithm ??
i know what is perfect algo but I want to know what’s wrong with my algo??
Codeforces last round question A(reorder)
hello @ankit_verma
a) check ur forumula, in place of ans[n] it should be asns[i]
b) in question is mentioned that roundin willl not occur,but u r doing same
c) even if u correct them ur solution will give tle becuase time complexity of this alogirithm is O(N^2)
you don’t understand what is my algorithms
this is what I want to say look into this and this show wrong and only not TLE
PLS EXPLAIN WHAT U R TRYING
i am solving here by taking LCM, here i’m taking LCM of 1,2,3 then i solving using math only
WHAT MATH U R DOING AFTER LCM?
here i’m using LCM(1,2,3) =6
okkk
just tell me how you solve (1/2+1/3+1/4)=??
AATI HAI SIR , BUT SAYAD AAPKO QUESTION SAMAJH NAHI AAYA
mere toh pura question aaya hua h samajh m phle jo question bola h usse toh bataiye
U HAVE TO TELL WHETHER THERE EXIST ANY ORDER SUCH THAT THIS SUM EQUAL TO M .
AND HERE ORDER WILL MATTER .
U CANNOT COMPUTE FOR ANY ONE COMBINATION AND DECIDE YES NO
bhai nahi batana ho toh mana kar do na kyun fir paisa bhi le rahe ho or batate bhi nahi ho ??
abhi bhi tumhara doubt clr nahi hua kya?
here ans[n] will conatin lcm of (1,2,3…n)
but u actually have to use lcm of (i+1.,i+2…n)
sir ji yeh sahi likha h mene kyunki 1 to n wale k liye lcm hi (i to n ) k liye bhi hoga…
aap koi esa test case bataiye t=1 k liye jo mere code se galat ans de raha h??
pls share the problem link with me.
submit ur code and check 5th test case . expected answer is yes , urs is giving no.
it doesn’t show the whole test case that is very long test case, so can you think small tast case so that i can understand where i wrong?
no i dont have any case.
iss question ka approach bata dijiye?? kya hoga


’